Jelajahi Sumber

Merge branch 'master' of github.com:ChristianChiarulli/nvcode

Chris 4 tahun lalu
induk
melakukan
cd764de1bf

+ 2 - 0
init.lua

@@ -48,8 +48,10 @@ require('lsp')
 require('lsp.clangd')
 require('lsp.lua-ls')
 require('lsp.bash-ls')
+require('lsp.go-ls')
 require('lsp.js-ts-ls')
 require('lsp.python-ls')
+require('lsp.rust-ls')
 require('lsp.json-ls')
 require('lsp.yaml-ls')
 require('lsp.vim-ls')

+ 3 - 0
lua/lsp/efm-general-ls.lua

@@ -13,6 +13,7 @@ local flake8 = {
 local isort = {formatCommand = "isort --quiet -", formatStdin = true}
 
 local yapf = {formatCommand = "yapf --quiet", formatStdin = true}
+local black = {formatCommand = "black --quiet --stdin-filename ", formatStdin = true}
 
 if O.python.linter == 'flake8' then
 	table.insert(python_arguments, flake8)
@@ -20,6 +21,8 @@ end
 
 if O.python.formatter == 'yapf' then
 	table.insert(python_arguments, yapf)
+elseif O.python.formatter == 'black' then
+    table.insert(python_arguments, black)
 end
 
 if O.python.isort then

+ 4 - 0
lua/lsp/go-ls.lua

@@ -0,0 +1,4 @@
+require'lspconfig'.gopls.setup{
+    cmd = {DATA_PATH .. "/lspinstall/go/gopls"},
+    on_attach = require'lsp'.common_on_attach
+}

+ 5 - 0
lua/lsp/rust-ls.lua

@@ -0,0 +1,5 @@
+require'lspconfig'.rust_analyzer.setup{
+    cmd = {DATA_PATH .. "/lspinstall/rust/rust-analyzer"},
+    on_attach = require'lsp'.common_on_attach
+}
+

+ 2 - 3
lua/nv-autopairs/init.lua

@@ -36,10 +36,9 @@
 --     return npairs.check_break_line_char()
 --   end
 -- end
--- 
--- 
+--
+--
 -- remap('i' , '<CR>','v:lua.MUtils.completion_confirm()', {expr = true , noremap = true})
-
 -- TODO switch to lua plugin when possible
 vim.cmd([[
 let g:lexima_no_default_rules = v:true

+ 1 - 1
lua/nv-globals.lua

@@ -4,7 +4,7 @@ O = {
     colorscheme = 'nvcode',
     python = {
         linter = '',
-        -- @usage can be 'yapf'
+        -- @usage can be 'yapf', 'black'
         formatter = '',
         autoformat = false,
         isort = false,

+ 6 - 8
lua/nv-telescope/init.lua

@@ -62,14 +62,12 @@ require('telescope').setup {
             }
         }
     },
-    require'telescope'.setup {
-        extensions = {
-            media_files = {
-                -- filetypes whitelist
-                -- defaults to {"png", "jpg", "mp4", "webm", "pdf"}
-                filetypes = {"png", "webp", "jpg", "jpeg"},
-                find_cmd = "rg" -- find command (defaults to `fd`)
-            }
+    extensions = {
+        media_files = {
+            -- filetypes whitelist
+            -- defaults to {"png", "jpg", "mp4", "webm", "pdf"}
+            filetypes = {"png", "webp", "jpg", "jpeg"},
+            find_cmd = "rg" -- find command (defaults to `fd`)
         }
     }
 }

+ 1 - 1
lua/nv-treesitter/init.lua

@@ -5,7 +5,7 @@ require'nvim-treesitter.configs'.setup {
     highlight = {
         enable = true -- false will disable the whole extension
     },
-    indent = {enable = true},
+    indent = {enable = true, disable = {"python"}},
     playground = {
         enable = true,
         disable = {},

+ 0 - 3
test.py

@@ -1,3 +0,0 @@
-
-def thing(parameter_list):
-    pass

+ 1 - 1
vimscript/nv-whichkey/init.vim

@@ -3,7 +3,7 @@
 " Timeout
 let g:which_key_timeout = 100
 
-let g:which_key_display_names = {'<CR>': '↵', '<TAB>': '⇆'}
+let g:which_key_display_names = {'<CR>': '↵', '<TAB>': '⇆', " ": 'SPC'}
 
 " Map leader to which_key
 nnoremap <silent> <leader> :silent <c-u> :silent WhichKey '<Space>'<CR>