Chris 4 年之前
父节点
当前提交
413acae7a0
共有 7 个文件被更改,包括 55 次插入17 次删除
  1. 3 0
      init.lua
  2. 1 15
      lua/lsp/init.lua
  3. 2 2
      lua/nv-nvimtree/init.lua
  4. 7 0
      lua/nv-quickscope/init.lua
  5. 24 0
      lua/nv-rnvimr/init.lua
  6. 17 0
      lua/nv-startify/init.lua
  7. 1 0
      lua/plugins.lua

+ 3 - 0
init.lua

@@ -13,6 +13,9 @@ require('nv-bufferline')
 require('nv-gitsigns')
 require('nv-gitsigns')
 require('nv-nvim-autopairs')
 require('nv-nvim-autopairs')
 require('nv-kommentary')
 require('nv-kommentary')
+require('nv-quickscope')
+require('nv-rnvimr')
+require('nv-startify')
 
 
 -- LSP
 -- LSP
 require('lsp')
 require('lsp')

+ 1 - 15
lua/lsp/init.lua

@@ -4,21 +4,6 @@ vim.fn.sign_define("LspDiagnosticsSignWarning", {texthl = "LspDiagnosticsSignWar
 vim.fn.sign_define("LspDiagnosticsSignInformation", {texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"})
 vim.fn.sign_define("LspDiagnosticsSignInformation", {texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"})
 vim.fn.sign_define("LspDiagnosticsSignHint", {texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"})
 vim.fn.sign_define("LspDiagnosticsSignHint", {texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"})
 
 
---[[ vim.fn.sign_define("LspDiagnosticsVirtualTextError", {texthl = "LspDiagnosticsVirtualTextError", text = "", numhl = "LspDiagnosticsVirtualTextError"})
-vim.fn.sign_define("LspDiagnosticsVirtualTextWarning", {texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"})
-vim.fn.sign_define("LspDiagnosticsVirtualTextInformation", {texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"})
-vim.fn.sign_define("LspDiagnosticsVirtualTextHint", {texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"}) ]]
-
---[[ vim.fn.sign_define("LspDiagnosticsSignError", {text = ""})
-vim.fn.sign_define("LspDiagnosticsSignWarning", {text = ""})
-vim.fn.sign_define("LspDiagnosticsSignInformation", {text = ""})
-vim.fn.sign_define("LspDiagnosticsSignHint", {text = ""}) ]]
-
---[[ vim.fn.sign_define("LspDiagnosticsSignError", { text = " 🞮", numhl = "LspDiagnosticsDefaultError" })
-vim.fn.sign_define("LspDiagnosticsSignWarning", { text = " ▲", numhl = "LspDiagnosticsDefaultWarning" })
-vim.fn.sign_define("LspDiagnosticsSignInformation", { text = " ⁈", numhl = "LspDiagnosticsDefaultInformation" })
-vim.fn.sign_define("LspDiagnosticsSignHint", { text = " ⯁", numhl = "LspDiagnosticsDefaultHint" }) ]]
-
 vim.cmd('nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>')
 vim.cmd('nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>')
 vim.cmd('nnoremap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR>')
 vim.cmd('nnoremap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR>')
 vim.cmd('nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>')
 vim.cmd('nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>')
@@ -28,6 +13,7 @@ vim.cmd('nnoremap <silent> K :Lspsaga hover_doc<CR>')
 vim.cmd('nnoremap <silent> <C-k> <cmd>lua vim.lsp.buf.signature_help()<CR>')
 vim.cmd('nnoremap <silent> <C-k> <cmd>lua vim.lsp.buf.signature_help()<CR>')
 vim.cmd('nnoremap <silent> <C-p> :Lspsaga diagnostic_jump_prev<CR>')
 vim.cmd('nnoremap <silent> <C-p> :Lspsaga diagnostic_jump_prev<CR>')
 vim.cmd('nnoremap <silent> <C-n> :Lspsaga diagnostic_jump_next<CR>')
 vim.cmd('nnoremap <silent> <C-n> :Lspsaga diagnostic_jump_next<CR>')
+
 --[[ " autoformat
 --[[ " autoformat
 autocmd BufWritePre *.js lua vim.lsp.buf.formatting_sync(nil, 100)
 autocmd BufWritePre *.js lua vim.lsp.buf.formatting_sync(nil, 100)
 autocmd BufWritePre *.jsx lua vim.lsp.buf.formatting_sync(nil, 100)
 autocmd BufWritePre *.jsx lua vim.lsp.buf.formatting_sync(nil, 100)

+ 2 - 2
lua/nv-nvimtree/init.lua

@@ -13,8 +13,8 @@ let g:nvim_tree_show_icons = {
 "1 by default, notice that if 'files' is 1, it will only display
 "1 by default, notice that if 'files' is 1, it will only display
 "if nvim-web-devicons is installed and on your runtimepath ]]
 "if nvim-web-devicons is installed and on your runtimepath ]]
 -- vim.g.nvim_tree_ignore = [ '.git', 'node_modules', '.cache' ] "empty by default
 -- vim.g.nvim_tree_ignore = [ '.git', 'node_modules', '.cache' ] "empty by default
-vim.g.nvim_tree_disable_netrw = 0 --"1 by default, disables netrw
-vim.g.nvim_tree_hijack_netrw = 0 --"1 by default, prevents netrw from automatically opening when opening directories (but lets you keep its other utilities)
+-- vim.g.nvim_tree_disable_netrw = 0 --"1 by default, disables netrw
+-- vim.g.nvim_tree_hijack_netrw = 0 --"1 by default, prevents netrw from automatically opening when opening directories (but lets you keep its other utilities)
 vim.g.nvim_tree_hide_dotfiles = 1 --0 by default, this option hides files and folders starting with a dot `.`
 vim.g.nvim_tree_hide_dotfiles = 1 --0 by default, this option hides files and folders starting with a dot `.`
 vim.g.nvim_tree_indent_markers = 1 --"0 by default, this option shows indent markers when folders are open
 vim.g.nvim_tree_indent_markers = 1 --"0 by default, this option shows indent markers when folders are open
 vim.g.nvim_tree_follow = 1 --"0 by default, this option allows the cursor to be updated when entering a buffer
 vim.g.nvim_tree_follow = 1 --"0 by default, this option allows the cursor to be updated when entering a buffer

+ 7 - 0
lua/nv-quickscope/init.lua

@@ -0,0 +1,7 @@
+-- Trigger a highlight in the appropriate direction when pressing these keys:
+-- vim.cmd('let g:qs_highlight_on_keys = [\'f\', \'F\', \'t\', \'T\']')
+vim.g.qs_highlight_on_keys = {'f', 'F', 't', 'T'}
+
+vim.api.nvim_exec('highlight QuickScopePrimary guifg=\'#00C7DF\' gui=underline ctermfg=155 cterm=underline', false)
+vim.cmd('highlight QuickScopeSecondary guifg=\'#eF5F70\' gui=underline ctermfg=81 cterm=underline')
+vim.g.qs_max_chars=150

+ 24 - 0
lua/nv-rnvimr/init.lua

@@ -0,0 +1,24 @@
+-- Make Ranger replace netrw and be the file explorer
+vim.g.rnvimr_ex_enable = 1
+vim.g.rnvimr_draw_border = 1
+
+-- Make Ranger to be hidden after picking a file
+vim.g.rnvimr_pick_enable = 1
+
+-- Make Neovim to wipe the buffers corresponding to the files deleted by Ranger
+vim.g.rnvimr_bw_enable = 1
+
+vim.cmd('nmap <leader>r :RnvimrToggle<CR>')
+
+--[[ let g:rnvimr_ranger_cmd = 'ranger --cmd="set column_ratios 1,1"'
+            " \ --cmd="set draw_borders separators"'
+
+" let g:rnvimr_layout = { 'relative': 'editor',
+"             \ 'width': float2nr(round(0.6 * &columns)),
+"             \ 'height': float2nr(round(0.6 * &lines)),
+"             \ 'col': float2nr(round(0.2 * &columns)),
+"             \ 'row': float2nr(round(0.2 * &lines)),
+"             \ 'style': 'minimal' }
+
+let g:rnvimr_presets = [
+            \ {'width': 0.800, 'height': 0.800}] ]]

+ 17 - 0
lua/nv-startify/init.lua

@@ -0,0 +1,17 @@
+vim.g.startify_custom_header = {
+        '        _   ___    ________          __   ',
+        '       / | / / |  / / ____/___  ____/ /__ ',
+        '      /  |/ /| | / / /   / __ \\/ __  / _ \\',
+        '     / /|  / | |/ / /___/ /_/ / /_/ /  __/',
+        '    /_/ |_/  |___/\\____/\\____/\\__,_/\\___/ ',
+        }
+
+vim.g.webdevicons_enable_startify = 1
+vim.g.startify_enable_special = 0
+vim.g.startify_session_dir = '~/.config/nvim/session'
+vim.g.startify_session_autoload = 1
+vim.g.startify_session_delete_buffers = 1
+vim.g.startify_change_to_vcs_root = 1
+vim.g.startify_fortune_use_unicode = 1
+vim.g.startify_session_persistence = 1
+vim.g.startify_session_dir = '~/.config/nvim/session'

+ 1 - 0
lua/plugins.lua

@@ -81,4 +81,5 @@ return require('packer').startup(function()
   use 'AndrewRadev/tagalong.vim'
   use 'AndrewRadev/tagalong.vim'
   use 'alvan/vim-closetag'
   use 'alvan/vim-closetag'
   use { 'glacambre/firenvim', run = function() vim.fn['firenvim#install'](1) end }
   use { 'glacambre/firenvim', run = function() vim.fn['firenvim#install'](1) end }
+  use 'liuchengxu/vim-which-key'
 end)
 end)