From 7cca2690386b568eacb5ccf5e9e21a3bcccd9a54 Mon Sep 17 00:00:00 2001 From: saibotk Date: Sun, 17 Apr 2022 21:31:47 +0200 Subject: [PATCH] refactor pluginoptions to lua --- nvim/init.lua | 8 ++--- nvim/lua/pluginoptions.lua | 69 +++++++++++++++++++++++++++++++++++++ nvim/pluginoptions.vim | 70 -------------------------------------- 3 files changed, 71 insertions(+), 76 deletions(-) create mode 100644 nvim/lua/pluginoptions.lua delete mode 100644 nvim/pluginoptions.vim diff --git a/nvim/init.lua b/nvim/init.lua index d96d897..1653d35 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,14 +1,10 @@ -local nvim_config_root = '~/.config/nvim' - -- BASIC OPTIONS require('plugins') require('options') require('mappings') +require('pluginoptions') --- VIM PLUGIN OPTIONS -vim.cmd('source ' .. nvim_config_root .. '/pluginoptions.vim') - --- LUA PLUGIN OPTIONS +-- PLUGIN OPTIONS require('telescopeconfig') require('autocompletion') require('treesitterconfig') diff --git a/nvim/lua/pluginoptions.lua b/nvim/lua/pluginoptions.lua new file mode 100644 index 0000000..08a33c9 --- /dev/null +++ b/nvim/lua/pluginoptions.lua @@ -0,0 +1,69 @@ +-- PLUGIN OPTIONS + + +-- GITGUTTER SETUP +-- ========================= +vim.api.nvim_set_var('gitgutter_sign_added', '∙') +vim.api.nvim_set_var('gitgutter_sign_modified', '∙') +vim.api.nvim_set_var('gitgutter_sign_removed', '∙') +vim.api.nvim_set_var('gitgutter_sign_modified_removed', '∙') + +vim.cmd [[ +augroup VimDiff + autocmd! + autocmd VimEnter,FilterWritePre * if &diff | GitGutterDisable | endif +augroup END +]] + +-- VIMWIKI SETUP +-- ========================= +vim.api.nvim_set_var('vimwiki_list', {{path = '~/.notes/', syntax = 'markdown', ext = '.md'}}) +vim.api.nvim_set_var('vimwiki_hl_headers', 1) +vim.api.nvim_set_var('vimwiki_listsyms', ' X') + +-- VIMTEX SETUP +-- ========================= + +vim.api.nvim_set_var('vimtex_compiler_engine', 'lualatex') +vim.api.nvim_set_var('vimtex_quickfix_mode', 0) +vim.api.nvim_set_var('tex_flavor', 'latex') +vim.api.nvim_set_var('vimtex_compiler_method', 'latexmk') +vim.api.nvim_set_var('vimtex_compiler_latexmk', { + backend = 'nvim', + background = 1, + build_dir = '', + callback = 1, + continuous = 1, + executable = 'latexmk', + hooks = {}, + options = {'-pdflatex=lualatex', '-file-line-error', '-synctex=1', '-interaction=nonstopmode'} +}) + +-- TMUX SETUP +-- ========================= +vim.api.nvim_set_var('tmuxcomplete#trigger', '') + + +-- GOYO +-- ========================= + +vim.cmd [[ +function! s:goyo_enter() + set noshowcmd + set scrolloff=999 +endfunction + +function! s:goyo_leave() + set showcmd + set scrolloff=1 +endfunction + +autocmd! User GoyoEnter nested call goyo_enter() +autocmd! User GoyoLeave nested call goyo_leave() +]] + +vim.api.nvim_set_var('goyo_width', 120) + +-- COLORS.LUA SETUP +-- ========================= +require('colorizer').setup() diff --git a/nvim/pluginoptions.vim b/nvim/pluginoptions.vim deleted file mode 100644 index 9aaa03d..0000000 --- a/nvim/pluginoptions.vim +++ /dev/null @@ -1,70 +0,0 @@ -" PLUGIN OPTIONS - -" GITGUTTER SETUP -" ========================= -let g:gitgutter_sign_added = '∙' -let g:gitgutter_sign_modified = '∙' -let g:gitgutter_sign_removed = '∙' -let g:gitgutter_sign_modified_removed = '∙' -augroup VimDiff - autocmd! - autocmd VimEnter,FilterWritePre * if &diff | GitGutterDisable | endif -augroup END - -" VIMWIKI SETUP -" ========================= -let g:vimwiki_list = [{'path': '~/.notes/', - \ 'syntax': 'markdown', 'ext': '.md'}] -let g:vimwiki_hl_headers = 1 -let g:vimwiki_listsyms = ' X' - -" VIMTEX SETUP -" ========================= - -let g:vimtex_compiler_engine = 'lualatex' -let g:vimtex_quickfix_mode = 0 -let g:tex_flavor = 'latex' -let g:vimtex_compiler_method = 'latexmk' -let g:vimtex_compiler_latexmk = { - \ 'backend' : 'nvim', - \ 'background' : 1, - \ 'build_dir' : '', - \ 'callback' : 1, - \ 'continuous' : 1, - \ 'executable' : 'latexmk', - \ 'hooks' : [], - \ 'options' : [ - \ '-pdflatex=lualatex', - \ '-file-line-error', - \ '-synctex=1', - \ '-interaction=nonstopmode', - \ ], - \} - -" COLORS.LUA SETUP -" ========================= - -lua require'colorizer'.setup() - -" TMUX SETUP -" ========================= - -let g:tmuxcomplete#trigger = '' - -" GOYO -" ========================= - -function! s:goyo_enter() - set noshowcmd - set scrolloff=999 -endfunction - -function! s:goyo_leave() - set showcmd - set scrolloff=1 -endfunction - -autocmd! User GoyoEnter nested call goyo_enter() -autocmd! User GoyoLeave nested call goyo_leave() - -let g:goyo_width = 120