commit 008a30403bef28263b5802d24791948a25bc9ddd
parent 158d6cc1e11dfeb68716c6cec4b0a39d0d319122
Author: Szymon Mikulicz <szymon.mikulicz@posteo.net>
Date: Sun, 10 Jul 2022 13:35:52 +0200
Update nvim
Diffstat:
2 files changed, 114 insertions(+), 13 deletions(-)
diff --git a/nvim/.config/nvim/ginit.vim b/nvim/.config/nvim/ginit.vim
@@ -3,3 +3,7 @@ if exists('g:GtkGuiLoaded')
elseif exists('g:GuiLoaded')
Guifont Fira Mono:h10
endif
+
+colorscheme onehalfdark
+let g:neovide_transparency=0.9
+set guifont=Fira\ Mono:h12
diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim
@@ -31,21 +31,33 @@ function! PackInit() abort
call minpac#add('paretje/deoplete-notmuch', {'type': 'opt'})
+ call minpac#add('rasjani/robotframework-vim', {'type': 'opt', 'subdir': 'after'})
+
+ call minpac#add('stephpy/vim-yaml', {'type': 'opt', 'subdir': 'after'})
+
+ call minpac#add('burnettk/vim-jenkins', {'type': 'opt'})
+
+ call minpac#add('godlygeek/tabular')
+ call minpac#add('plasticboy/vim-markdown', {'type': 'opt'})
+
+ call minpac#add('jackguo380/vim-lsp-cxx-highlight', {'type': 'opt'})
+
call minpac#add('sonph/onehalf', {'subdir': 'vim'})
call minpac#add('itchyny/lightline.vim')
call minpac#add('scrooloose/nerdtree')
call minpac#add('Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' })
- call minpac#add('Shougo/neosnippet.vim')
- call minpac#add('Shougo/neosnippet-snippets')
call minpac#add('tpope/vim-fugitive')
call minpac#add('chaoren/vim-wordmotion')
- call minpac#add('neovim/nvim-lsp')
+ call minpac#add("williamboman/nvim-lsp-installer")
+ call minpac#add('neovim/nvim-lspconfig')
call minpac#add('Shougo/deoplete-lsp')
+
+ call minpac#add('grafi-tt/lunajson', {'name': 'lunajson/lua', 'subdir': 'src'})
endfunction
command! PackUpdate call PackInit() | call minpac#update()
@@ -54,12 +66,6 @@ command! PackStatus call PackInit() | call minpac#status()
packloadall
-" Neosnipet
-" Note: It must be "imap" and "smap". It uses <Plug> mappings.
-imap <C-j> <Plug>(neosnippet_expand_or_jump)
-smap <C-j> <Plug>(neosnippet_expand_or_jump)
-xmap <C-j> <Plug>(neosnippet_expand_target)
-
" lightline
let g:lightline = {
\ 'colorscheme': 'onehalfdark',
@@ -75,14 +81,69 @@ endif
let g:vimtex_view_method = 'zathura'
let g:vimtex_compiler_progname = 'nvr'
let g:vimtex_quickfix_enabled = 0
+let g:vimtex_compiler_latexmk = {
+ \ 'options' : [
+ \ '-pdf',
+ \ '-shell-escape',
+ \ '-verbose',
+ \ '-file-line-error',
+ \ '-synctex=1',
+ \ '-interaction=nonstopmode',
+ \ ],
+ \}
"NERDTree
map <C-k> :NERDTreeToggle<CR>
+"Jenkins
+let g:jenkins_url = 'http://krk-sb13-19.soc-mgt.krk-lab.nsn-rdnet.net:8080'
+let g:jenkins_username = 'admin'
+let g:jenkins_password = 'egenrules'
+
" nvim-lsp
-lua require'nvim_lsp'.rust_analyzer.setup{}
-lua require'nvim_lsp'.pyls_ms.setup{cmd={"mspyls"}}
-lua require'nvim_lsp'.texlab.setup{}
+lua << EOF
+
+function nil2em(str)
+ if str == nil then
+ return ""
+ else
+ return str
+ end
+end
+
+require("nvim-lsp-installer").setup {}
+
+local clang = io.popen('clang -print-resource-dir')
+local lspconfig = require'lspconfig'
+local json = require'lunajson'
+local compc = io.open("compile_commands.json","r")
+local gccp = "gcc"
+
+if compc ~= nil then
+ gccp = json.decode(compc:read("*a"))[1].arguments[1]
+end
+
+local gccs = io.popen(gccp .. " -print-sysroot")
+local gcct = io.popen(gccp .. " -dumpmachine")
+
+lspconfig.ccls.setup {
+ init_options = {
+ clang = {
+ resourceDir = clang:read("*l");
+ extraArgs = {
+ "--sysroot="..nil2em(gccs:read("*l")).."/",
+ "-target="..gcct:read("*l")
+ };
+ };
+ highlight = {
+ lsRanges = true;
+ };
+ };
+ };
+
+gcct:close()
+clang:close()
+EOF
" Deoplete
inoremap <expr><C-h> deoplete#smart_close_popup()."\<C-h>"
@@ -181,17 +242,46 @@ function SetFishOptions()
packadd vim-fish
endfunction
+autocmd BufNewFile,BufRead Jenkinsfile,*.Jenkinsfile call SetJenkinsfileOptions()
+function SetJenkinsfileOptions()
+ packadd vim-jenkins
+ setf perl
+endfunction
+
+autocmd BufNewFile,BufRead *.robot set filetype=robot
+autocmd Filetype robot call SetRobotOptions()
+function SetRobotOptions()
+ packadd robotframework-vim
+endfunction
+
autocmd Filetype i3config call SetI3Options()
function SetI3Options()
packadd i3config.vim
endfunction
+autocmd Filetype markdown call SetMDOptions()
+function SetMDOptions()
+ packadd vim-markdown
+endfunction
+
+autocmd FileType yaml call SetYAMLOptions()
+function SetYAMLOptions()
+ packadd vim-yaml
+ setlocal ts=2 sts=2 sw=2 expandtab
+endfunction
+
+autocmd FileType c call SetCOptions()
+autocmd FileType cpp call SetCOptions()
+function SetCOptions()
+ packadd vim-lsp-cxx-highlight
+endfunction
+
autocmd CompleteDone * silent! pclose
" vim settings
set hidden
-set lazyredraw
+" set lazyredraw
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
@@ -205,6 +295,7 @@ set shiftwidth=4
set expandtab
set autoindent
set noea
+set inccommand=split
filetype plugin indent on
@@ -213,8 +304,14 @@ syntax on
colorscheme onehalfdark
hi Normal guibg=none
hi LineNr guibg=none
+nmap ,d :b#<bar>bd#<CR>
tnoremap <Esc> <C-\><C-n>
au TermOpen * setlocal nonumber norelativenumber
au BufReadPost APKBUILD set syntax=sh noexpandtab
+
+augroup LuaHighlight
+ autocmd!
+ autocmd TextYankPost * silent! lua require'vim.highlight'.on_yank()
+augroup END