Giter Site home page Giter Site logo

smartjump.nvim's Introduction

smartjump.nvim

Advanced gf command for neovim.

smartjump.nvim will lookup the filename under the cursor in vim.o.path.

Screenshot

There are several main.go file in the project, smartjump will find it in all folders defined by path variable, and show them with line number awareness.

smartjump

Installation and Setup

Using packer:

use {"moevis/smartjump.nvim", requires = "nvim-telescope/telescope.nvim"}

Default setup (optional):

require("smartjump").setup({
  -- telescope config
  telescope = {
    prompt_title = "Go To File",
  },
  -- or require("telescope.themes").get_dropdown()/.get_ivy()/.get_cursor()
  theme = nil,
})

Set keymap (by lua):

-- maping to 'gl'
vim.keymap.set("n", "gl", ":GoToFile<cr>", nil)

-- or you can replace default 'gf' command
vim.keymap.set("n", "gf", ":GoToFile<cr>", nil)

Command and Setup

Key mapping (Telescope default behaviors):

  • <Enter>: open the file in current buffer.
  • <C-t>: open the file in new tab.
  • <C-x>: open file in horizontal window.
  • <C-v>: open file in vertical window.

Tips

You can define a custom vim.o.path for your project by adding a local .vimrc in your project root.

set path=/usr/include,/usr/local/include

And remember add these lines in your init.vim:

set exrc " equal to vim.opt.exrc = true
set secure " equal to vim.opt.secure = true

smartjump.nvim's People

Contributors

moevis avatar

Stargazers

August Masquelier avatar Md Saif avatar Rafael Bodill avatar Bálint Böde avatar Lalit Kumar avatar Andrew Stewart avatar Andy Shevchenko avatar Farzad Majidfayyaz avatar  avatar kohane27 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.