Skip to content

Wjinlei/nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

187 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

preview

Features

  • Beautiful UI
  • Better replace
  • Better search
  • Better comment
  • Better format
  • LSP (Language server)
    • html/js/css
    • react
    • vue
    • c/c++
    • rust
    • go
    • python
    • shell
    • json
    • lua
  • Code format
  • Code snappet
  • Code Outline
  • File browser
  • Markdown preview
  • Git integration
  • Tmux integration
  • Toogle terminal
  • ...

Requirements

  • Neovim >= 0.11.0
  • Python3 install pynvim
  • Nodejs install neovim
  • Install Nerd font

Install

git clone https://github.com/Wjinlei/nvim.git ~/.config/nvim

After Installation, You Need To

  • Set python3 path
vim ~/.config/nvim/python_host.lua
  • Do :checkhealth

Keymap

File browser

  • Open file browser tt

Markdown preview

  • Open preview in default browser <C-c>m

Better comment

  • Comment current gcc
  • Comment select area gc

Better search

  • Search file ff
  • Search string fs
  • Search project file fp
  • Search git file fg
  • Search history file fh
  • Search buffer bb
  • Hop search . & ,

Better replace

  • Search and replace fr
  • Search and replace current word fw

Git integration

  • Folding of unchanged text gf
  • Goto next hunk gn
  • Goto prev hunk gp
  • Git status gs

LSP

You must install a language server <LEADER>lsp

  • Code Outline C-o
  • Code Rename <LEADER>rn
  • Code Format <LEADER>f
  • Show bufr diagnostic <A-d>
  • Goto prev diagnostic <A-i>
  • Goto next diagnostic <A-n>
  • Code action <C-a>
  • Goto declaration gD
  • Goto definition gd
  • Goto implementation gi
  • Goto references gr
  • Goto type_definition gt
  • Goto hover gh
  • Goto signature_help gH

Other

  • Toggle terminal C-\
  • Startup time <C-c>s
  • Sudo write <LEADER>w
  • Sudo read <LEADER>r
  • PackerInstall <C-x>i
  • PackerSync <C-x>u
  • PackerCompile <C-x>x

Tmux integration

Must be in .tmux.conf Add the following configuration to conf

Click to expand
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"

bind-key -n 'M-h' if-shell "$is_vim" 'send-keys M-h' { if -F '#{pane_at_left}' '' 'select-pane -L' }
bind-key -n 'M-j' if-shell "$is_vim" 'send-keys M-j' { if -F '#{pane_at_bottom}' '' 'select-pane -D' }
bind-key -n 'M-k' if-shell "$is_vim" 'send-keys M-k' { if -F '#{pane_at_top}' '' 'select-pane -U' }
bind-key -n 'M-l' if-shell "$is_vim" 'send-keys M-l' { if -F '#{pane_at_right}' '' 'select-pane -R' }

bind-key -T copy-mode-vi 'M-h' if -F '#{pane_at_left}' '' 'select-pane -L'
bind-key -T copy-mode-vi 'M-j' if -F '#{pane_at_bottom}' '' 'select-pane -D'
bind-key -T copy-mode-vi 'M-k' if -F '#{pane_at_top}' '' 'select-pane -U'
bind-key -T copy-mode-vi 'M-l' if -F '#{pane_at_right}' '' 'select-pane -R'

bind -n 'Left' if-shell "$is_vim" 'send-keys Left' 'resize-pane -L 1'
bind -n 'Down' if-shell "$is_vim" 'send-keys Down' 'resize-pane -D 1'
bind -n 'Up' if-shell "$is_vim" 'send-keys Up' 'resize-pane -U 1'
bind -n 'Right' if-shell "$is_vim" 'send-keys Right' 'resize-pane -R 1'

bind-key -T copy-mode-vi Left resize-pane -L 1
bind-key -T copy-mode-vi Down resize-pane -D 1
bind-key -T copy-mode-vi Up resize-pane -U 1
bind-key -T copy-mode-vi Right resize-pane -R 1

Preview

Vue Vue Rust Rust Go Go Shell Shell Lua Lua

FAQ

  1. 安装插件失败?
请确认是否科学上网,注意使用全局代理,光浏览器代理是没用的。
然后使用<C-x>i继续安装插件,直到所有插件安装成功

Thanks to the authors of the following projects

Friendship Links

About

my new nvim config

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages