Skip to content

burstknight/nvim_setting

Repository files navigation

nvim_setting

This repo is my neovim setting.

Requirements

Neovim version must be 0.10+.

Some plugins need use nerd font, so we need download a font from this web. And then decompress the downloaded compressed file. Finally, please copy *.ttf files into the path /usr/local/share/fonts.

You can read INSTALL.md to get more information to setup neovim.

If you want to use neovim to write gdscript for godot, you have to install godot 4.x.

Used plugins

For common functions

For LSP(Language Server Protocol) functions

For auto completion

  • nvim-cmp: It is a completion engine.
  • cmp-nvim-lsp: It can offer information from LSP server to the plugin nvim-cmp for auto completion.
  • cmp-path: The plugin nvim-cmp need use it for auto completion filesystem paths.
  • cmp-cmdline: The plugin nvim-cmp need use it to implement the completion for command mode.
  • cmp-buffer: The plugin nvim-cmp need use it to implement the completion for buffer words.
  • vim-vsnip: It can insert vscode style snippets during typing code for auto completion.
  • cmp-vsnip: The plugin vim-vsnip need use it to insert vscode style snippets for auto completion.
  • friendly-snippets: This plugin has defined many snippets for auto completion.

For DAP(Debug Adapter Protocol)

  • nvim-dap: It is implemented for DAP(Debug Adapter Protocol) client.
  • nvim-dap-virtual-text: It can show debug information on neovim during debugging using neovim.
  • nvim-dap-ui: It can offer cool UI on neovim for DAP.
  • mason-nvim-dap.nvim: It can use the plugin mason.nvim to automatically install DAP servers.

Keymaps

I use space key as the leader key for neovim.

Keymaps for common functions

Keymaps Description
<F2> Open the file browser.
<F8> Insert the doxygen style comment for a function signature.
Ctrl + p Fuzzy search the file from the current project.
Ctrl + f Use grep to search keyword from the current project.
<leader>mp Open the web browser to preview the current markdown file.
<leader>ms Stop previewing the current markdown file.
<leader>mt Toggle to preview the current markdown file.
<leader>G Use the plugin gitignore.nvim to generate .gitignore.

Keymaps for floating terminal

Keymaps Description
<leader>t Open the floating terminal on neovim.
Ctrl + k Return normal mode for the floating terminal on neovim.

Keymaps for LSP

Keymaps Description
<leader>lr Rename for variable or function.
<leader>la Perform code action.
<leader>ld Go to definition for variable or function.
<leader>lf Find the definition, reference or implementation for the keyword.
<F3> Open the outline for the currrent file.
<leader>lh Hover the document for variable or function.
<leader>= Format the currrent code.

Keymaps for completion

Keymaps Description
Alt + j Toggle for completion.
Alt + k Abort for completion.
Tab Move the next item of the candidate list for completion.
Shift + Tab Move the previous item of the candidate list for completion.
Enter Select the current item of the candidate list for completion.

Keymaps for DAP

Keymaps Description
<leader>db Add or remove the break point.
<leader>dc Continue running for debugging.
<leader>dd Disconnect for DAP.
<leader>dn Run the next statement for debugging.
<leader>dq Close DAP.
<leader>ds Run a step into the currrent function for debugging.
<leader>dx Terminate DAP.

Keymaps for leetcode.nvim

Keymaps Description
<leader>LL Open the plugin leetcode.nvim.
<leader>Lq Close the plugin leetcode.nvim.
<leader>Lm Return the menu.
<leader>Ld Open the question of the today.
<leader>Ll Open a problem list picker.
<leader>LR Open a random question.
<leader>Lr Run the currently opened question.
<leader>La Change the language for the currently opened question.
<leader>Ls Submit the currently opened question.

Keymaps for chadtree

Keymaps Description
q Close the file browser.
L Show the status for a file or directory.
i Open the selected file in horizontal split.
I Open the selected file in vertical split.
c Collpase all subdirectories for the directory at the currrent cursor on the file browser.
W Change the current working directory for neovim.
a Create a new file or a new directory at the location under the current cursor on the file browser.
r Rename a file or a directory.
c Copy the selected files for directories to the location under the current cursor on the file browser.
x Move the selected files or directories to the location under the current cursor on the files browser.
d Delete the selected files.

Try it on docker

For linux

If you want to try my configuration for neovim, you can run docker or podman with my dockerfiles.

First, you need run this command to build the image.

# For docker.
docker build -t neovim -f ./docker/Dockerfile.ubuntu .

# For podman
podman build -t neovim -f ./docker/Dockerfile.ubuntu .

Now, you can use this command to run the image as a container.

# For docker
docker run --rm -it neovim

# For podman
podman run --rm -it neovim

About

neovim setting files

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published