From 24a98625eb0350ad825821d039a6366851440ecf Mon Sep 17 00:00:00 2001 From: TiynGER Date: Thu, 29 Apr 2021 15:53:51 +0200 Subject: [PATCH] golang: added support for vim and set env --- .config/nvim/coc-settings.json | 78 ++++++++++++++++++++++++++++++++++ .config/nvim/init.vim | 7 ++- .profile | 9 ++-- 3 files changed, 89 insertions(+), 5 deletions(-) create mode 100644 .config/nvim/coc-settings.json diff --git a/.config/nvim/coc-settings.json b/.config/nvim/coc-settings.json new file mode 100644 index 0000000..c1f7539 --- /dev/null +++ b/.config/nvim/coc-settings.json @@ -0,0 +1,78 @@ +{ + "languageserver": { + "ccls": { + "command": "ccls", + "filetypes": [ + "c", + "cpp", + "objc", + "objcpp" + ], + "rootPatterns": [ + ".ccls", + "compile_commands.json", + ".vim/", + ".git/", + ".hg/" + ], + "initializationOptions": { + "cache": { + "diretory": "/tmp/ccls" + } + } + }, + "golang": { + "command": "gopls", + "rootPatterns": [ + "go.mod", + ".vim/", + ".git/", + ".hg/" + ], + "filetypes": [ + "go" + ] + }, + "haskell": { + "command": "haskell-language-server-wrapper", + "args": [ + "--lsp" + ], + "rootPatterns": [ + "*.cabal", + "stack.yaml", + "cabal.project", + "package.yaml", + "hie.yaml" + ], + "filetypes": [ + "hs", + "lhs", + "haskell", + "lhaskell" + ], + "initializationOptions": { + "haskell": { + } + } + }, + "hdlChecker": { + "command": "hdl_checker", + "args": [ + "--lsp" + ], + "filetypes": [ + "vhdl", + "verilog", + "systemverilog" + ] + }, + "nim": { + "command": "nimlsp", + "filetypes": [ + "nim" + ], + "trace.server": "verbose" + } + } +} diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index b3fe839..dce95ef 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -11,7 +11,8 @@ endif call plug#begin('~/.local/share/nvim/plugged') Plug 'airblade/vim-gitgutter' " git upgrades Plug 'alvan/vim-closetag' " auto close HTML tags -Plug 'donRaphaco/neotex' , {'for': 'tex'} " asynchronous pdf rendering +Plug 'donRaphaco/neotex' , {'for': 'tex'} " asynchronous pdf rendering for pdf +Plug 'fatih/vim-go' " better support for golang Plug 'frazrepo/vim-rainbow' " colorized matching brackets Plug 'itchyny/lightline.vim' " fancy statusline Plug 'junegunn/fzf.vim' " quickly jump files using fzf @@ -20,7 +21,6 @@ Plug 'majutsushi/tagbar', {'on': 'TagbarToggle'} " show tags Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'} " autocompletion Plug 'qpkorr/vim-renamer' " bulk renamer Plug 'raimondi/delimitmate' " automatic closing of brackets -"Plug 'rakr/vim-one' " adding colorscheme Plug 'rrethy/vim-hexokinase' , {'do': 'make hexokinase'} " color Preview Plug 'ryanoasis/vim-devicons' " enable icons for vim Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'} " filetree @@ -49,6 +49,9 @@ let g:closetag_close_shortcut = '>' " donRaphaco/neotex let g:neotex_enabled = 2 +" fatih/vim-go +let g:go_def_mapping_enabled = 0 + " frazrepo/vim-rainbow au FileType,BufNewFile,BufRead java,c,cpp,py,h call rainbow#load() diff --git a/.profile b/.profile index 3a590ba..f6c6bba 100644 --- a/.profile +++ b/.profile @@ -2,9 +2,10 @@ # Profile file. Runs on login. # Adds `~/.local/bin` and all subdirectories to $PATH -export PATH="$PATH:$(du "${HOME}/.local/bin/" | cut -f2 | tr '\n' ':' | sed 's/:*$//')" -export PATH=${HOME}/.nimble/bin:$PATH -export PATH=${HOME}/.pyenv/bin:$PATH +export PATH="${PATH}:$(du "${HOME}/.local/bin/" | cut -f2 | tr '\n' ':' | sed 's/:*$//')" +export PATH="${HOME}/.nimble/bin:${PATH}" +export PATH="${HOME}/.pyenv/bin:${PATH}" +export PATH="${GOBIN}:${PATH}" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" @@ -26,6 +27,8 @@ export XDG_DATA_HOME="${HOME}/.local/share" export ANDROID_SDK_HOME="${XDG_CONFIG_HOME}/android" export GNUPGHOME="${XDG_CONFIG_HOME}/gnupg" +export GOPATH="${HOME}/code/go" +export GOBIN="${GOPATH}/bin" export GRADLE_USER_HOME="${XDG_CONFIG_HOME}/gradle" export GTK2_RC_FILES="${XDG_CONFIG_HOME}/gtk-2.0/gtkrc-2.0" export HISTFILE="${XDG_CACHE_HOME}/shhistory"