From 9ce46ee39653d27314618c3929c27d59afdd4c3c Mon Sep 17 00:00:00 2001 From: Devon Tingley Date: Thu, 24 Mar 2022 21:27:32 -0400 Subject: [PATCH] Add lua, change shortcuts --- dotfiles/nvim/coc-settings.json | 7 ++++++- dotfiles/nvim/init.vim | 25 +++++++++++++++++-------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/dotfiles/nvim/coc-settings.json b/dotfiles/nvim/coc-settings.json index 2e950c8..1d7babf 100644 --- a/dotfiles/nvim/coc-settings.json +++ b/dotfiles/nvim/coc-settings.json @@ -1,3 +1,8 @@ { - "coc.preferences.formatOnSaveFiletypes": ["go"] + "coc.preferences.formatOnSaveFiletypes": ["go"], + "Lua.diagnostics.globals": [ + "vim" + ], + "Lua.telemetry.enable": true, + "sumneko-lua.enableNvimLuaDev": true } diff --git a/dotfiles/nvim/init.vim b/dotfiles/nvim/init.vim index 48324da..d50cca3 100644 --- a/dotfiles/nvim/init.vim +++ b/dotfiles/nvim/init.vim @@ -2,6 +2,7 @@ call plug#begin('~/.local/share/nvim/plugged') Plug 'vim-airline/vim-airline' Plug 'morhetz/gruvbox' Plug 'neoclide/coc.nvim', {'branch': 'release'} + Plug 'mattn/emmet-vim' call plug#end() "Theme @@ -15,6 +16,8 @@ set scrolloff=10 tnoremap command TMK w | call system("latexmk -pdf && latexmk -c") +command SHH set nonu norelativenumber scl=no +command NOSHH set nu relativenumber scl=auto inoremap pumvisible() ? coc#_select_confirm() \: "\u\\=coc#on_enter()\" @@ -31,19 +34,25 @@ let g:coc_global_extensions = [ \'coc-html', \'coc-css', \'coc-tsserver', - \'coc-flutter' + \'coc-flutter', + \'coc-sumneko-lua' \] " GoTo code navigation. -nmap def (coc-definition) -nmap typedef (coc-type-definition) -nmap impl (coc-implementation) -nmap ref (coc-references) +nmap gd (coc-definition) +nmap gt (coc-type-definition) +nmap gi (coc-implementation) +nmap gr (coc-references) " Misc coc-commands -nmap rename (coc-rename) -nmap help :CocDiagnostics -nmap git (coc-git-commit) +nmap r (coc-rename) +nmap R (coc-refactor) +nmap h call CocActionAsync('definitionHover') + +command Imports call CocActionAsync('organizeImport') +command GitDiff call CocActionAsync('runCommand', 'git.chunkInfo') +command GitUndo call CocActionASync('runCommand', 'git.chunkUndo') +command GitShow call CocActionAsync('runCommand', 'git.showCommit') " Language Specific Settings function! Golang_settings()