]> git.rmz.io Git - dotfiles.git/blobdiff - vim/vimrc
nvim: open init.lua file with <leader>en
[dotfiles.git] / vim / vimrc
index a7e23ac7f8ae701c578df0c6038fe7cff384c6be..a600c8e518836638273b0dafb1825c948d4c5a5d 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -911,8 +911,10 @@ nnoremap <silent> gs :<C-U>set operatorfunc=SortLinesOpFunc<CR>g@
 vnoremap <silent> gs :sort<cr>
 
 " edit configs  {{{2
+" TODO: populate location list with both .vim and .lua files
+" TODO: create file if it doesn't exist in nvim or vim rtps
 function! EditConfig(what, ext = '.vim')
-    if a:what == 'vimrc'
+    if a:what == 'vimrc' || a:what == 'init.lua'
         let l:file = a:what
     elseif empty(&filetype)
         echoe 'filetype is empty!'
@@ -923,6 +925,7 @@ function! EditConfig(what, ext = '.vim')
 
     execute ':Vvsplit! '.file
 endf
+nmap <leader>en :call EditConfig('init.lua')<CR>
 nmap <leader>ev :call EditConfig('vimrc')<CR>
 nmap <leader>ef :call EditConfig('ftplugin')<CR>
 nmap <leader>es :call EditConfig('syntax')<CR>