Skip to content

Rogerskelamen/nvim.lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Neovim in Lua version

It's time to take neovim to the moon :)

BGM if you wish.

If you prefer to use vimscript to configure your neovim, I recommend you to use my previous neovim configuration in vimL.

TODO: setup for nvim-dap-ui

🚀 Usage

Just copy and rename this repo to your $HOME/.config/nvim and get into neovim, lazy.nvim will do the rest of it. 😄Easy-peasy!

⚡️ Requirements

mason.nvim uses npm to install packages like lsps and daps, so you'd better have node installed.

For usage of telescope, ripgrep is required for live_grep and grep_string and is the first priority for find_files.

Necessary if you want to use rnvimr, which makes it easy for you to use ranger in your neovim. It's really great!

It's a python module for python client to communicate with NeoVim(also a checkhealth node). You'd better install it by executing pip install pynvim, because some plugins(like rnvimr) may depend on it.

If you want to use live-server nvim plugin to help you with html live displaying, you better globally install live-server by executing npm i live-server -g.

Neccessary if you want to autogenerate compile_commands.json in GNU make/cmake project(paired with clangd), which means the tool is similar to Bear. You may find that I add a run_file function to make filetype, so you are able to generate json file by pressing r if you really need it.(If you never write C program, then just leave it)

🛠️ LSP

Add a LSP

Cause I use mason-lspconfig.nvim for my lspconfig management, you should notice that mason.nvim package names are not paired with lspconfig server names in the APIs. There is a manual for all the mappings. As for dap server name mappings, please see this.

For example, if you want to install vue-language-server through mason.nvim, you should add volar instead in servers at user/lsp/mason.lua.

Configuration

If you want to configure the behavior of your lsp, please see this manual, or you can type :h lspconfig-all.

Take pyright for example, you should find 'pyright' in the manual, on that pyright section, you find there a repo on first line, click it and it will lead you to the pyright official repo. In that repo, you can find a manual about how to set pyright, then you just follow the manual to do your preferred configuration.

📜 Snippets

I use LuaSnip to manage all snippets and their behaviors. Don't worry about its function for it works well with nvim-cmp. Though the default snippets collection friendly-snippets holds enough useful snippets for most time, you might still want to add some by yourself.

Configuration

I believe the LuaSnip official document is well explained. And for my own preference, I make lua/snip as the default repo for custom snippets and load files in the lua way. So if you want to add a snippet, python for example, you could write snip in file python.lua by following the examples.

📋 Clipboard

Neovim does not support direct connection to the system clipboard, instead it depends on a provider to communicate with the system clipboard. For more details, press :h provider-clipboard.

Neovim default paste behavior in visual mode is keeping storing the word selected, which could be really annoying. I made a p keymap that everytime you paste content to a selected word, Neovim won't store it to register. So when you select a word in visual mode, just press p to paste and press P for line-tail word.

💡 Tips for Use

Sometimes we still could not remember some hot keys for functions like getting current character's hexadecimal value, so here is the list to lookup for if forget.

  • gO

    Get a popup window for current help document.

  • ga

    Get the decimal, hexadecimal, and octal value of current character under cursor.

  • :f or <C-g>

    Print the file name of current buffer.

  • <C-]>

    Jump to certain help document referred to current keyword under cursor.

  • q:

    Open cmdline-window, where you can execute or edit history commands(type :h command-line-window for more details)

💻 About NeoVim Win64

Look for Neovim configuration for Windows version? You may need to check out the other branch of this repo

LICENSE

GPLv3.

About

my nvim config in lua version

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages