Git Product home page Git Product logo

nvim's Introduction

nvim

Lua setup for nvim built on lazy.nvim

What the heck is this ?!?! How do I use ?!?

Some people may not know where to start when diving into this majestic configuration. This readme shall be your lighthouse. A beacon of hope in the dark stormy waters that is the developer experience.

The CONFIG

TBD ... migrating to lazy.nvim

Now let's start at,

The Basics

Many key combos use the <leader> key. For our config, the <leader> key is defined as the <space> key.

The clipboard within each instance of vim is contained. Meaning if you yank y something in nvim, you will not be able to paste it with CTL + v in other running programs. You will only be able to paste it into your existing vim instance with p.

Core Remaps

jk -> Alias to exit insert mode (Think ESC)

<leader>y -> Yank to system clipboard (Allows to paste elsewhere w/ CTL + v)

<leader>Y -> Yank until end of line to system clipboard (Allows to paste elsewhere w/ CTL + v)

<leader>p -> Paste with buffer preservation. Normally pasting over highlight results in highlighted portion overriding current paste buffer.

Navigation

telescope.nvim offers a modal with fuzzy match for files and file contents

<leader>pf -> Fuzzy find project files (files in CWD)

CTL + p -> Fuzzy find all git files

<leader>pv -> Navigate to netrw page for active file's directory

<leader>ps -> Live grep to search within files (don't forget to escape necessary characters)

Navigating search results

Within a telescope search, you can use nvim shortcuts to navigate the modal.

CTL + u -> Scroll up in preview window

CTL + d -> Scroll down in preview window

CTL + n -> Next search result (any mode)

CTL + p -> Previous search result (any mode)

CTL + c -> Close telescope (insert mode)

ESC -> Close telescope (normal mode)

jk -> Enter normal mode within the modal

While in normal mode in the telescope modal,

  • h and l will allow for navigation on the search line
  • j and k will allow for navigation within search results
  • Other vim commands will work on the search line while in this mode within telescope
Opening search results

While selecting a telescope search result, you have various options on how to open the result.

CTL + v -> Opens the selection in a veritcal pane in the current buffer

CTL + x -> Opens the selection in a horizontal pane in the current buffer

CTL + t -> Opens the selection in a new tab

Harpoon

Harpoon is used for fast context switching between files. These mappings can be changed easily in ./after/plugin/harpoon.lua.

CTL + e -> Open harpoon window - Can edit like any nvim buffer

CTL + a -> Add current file to harpoon list

CTL + h|t|n|s -> Will jump to the first 1st, 2nd, 3rd and 4th files in your harpoon list

LSP

Most important shortcuts to know for using the LSP. More details in ./after/plugin/lsp.lua

:Mason -> Command to open Mason language server modal - You can browse other language servers, and install with i

gd -> While your cursour is over any text object will attempt to go to the definition - Could be a variable definition, source file, etc...

K -> While your cursour is over any text object will show symbol information

<leader>vrn -> While your cursor is over any symbol, rename that symbol

<leader>vrr -> While your cursor is over any symbol, show symbol references

<leader>f -> LSP Format file

Autocompletion

CTL + y -> Select autocomplete suggestions

CTL + <space> -> Complete autocomplete suggestion

CTL + n -> Next autocomplete suggestion

CTL + p -> Previous autocomplete suggestion

Useful additions

<leader>ra -> Nice search and replace with regex. Will scope to highlighted area if applicable.

:Git blame -> Shows who to blame for code changes

Issues

  • Some users have reported fast scrolling exiting their nvim instance. Cannot reproduce /('_')/

nvim's People

Contributors

griffinpj avatar

Stargazers

Joseph Dewar avatar

Watchers

 avatar

Forkers

jontnguyen95

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.