Selaa lähdekoodia

Documentation generator (#200)

Biser Stoilov 4 vuotta sitten
vanhempi
commit
7fa7e3c275
6 muutettua tiedostoa jossa 21 lisäystä ja 3 poistoa
  1. 1 0
      init.lua
  2. 2 2
      lua/nv-dadbod/init.lua
  3. 1 0
      lua/nv-doge/init.lua
  4. 4 1
      lua/nv-globals.lua
  5. 3 0
      lua/plugins.lua
  6. 10 0
      vimscript/nv-whichkey/init.vim

+ 1 - 0
init.lua

@@ -37,6 +37,7 @@ require('nv-lightbulb')
 require('nv-indentline')
 require('nv-bookmark')
 require('nv-dadbod')
+require('nv-doge')
 -- require('nv-lspinstall')
 
 -- Which Key (Hope to replace with Lua plugin someday)

+ 2 - 2
lua/nv-dadbod/init.lua

@@ -2,5 +2,5 @@ vim.api.nvim_set_keymap("n", "<leader>Du", ":DBUIToggle<CR>", {noremap=true, sil
 vim.api.nvim_set_keymap("n", "<leader>Df", ":DBUIFindBuffer<CR>", {noremap=true, silent = true})
 vim.api.nvim_set_keymap("n", "<leader>Dr", ":DBUIRenameBuffer<CR>", {noremap=true, silent = true})
 vim.api.nvim_set_keymap("n", "<leader>Dl", ":DBUILastQueryInfo<CR>", {noremap=true, silent = true})
-vim.g.db_ui_save_location = O.db_ui_save_location
-vim.g.db_ui_auto_execute_table_helpers = 1
+vim.g.db_ui_save_location = O.database.save_location
+vim.g.db_ui_auto_execute_table_helpers = O.database.auto_execute

+ 1 - 0
lua/nv-doge/init.lua

@@ -0,0 +1 @@
+vim.g.doge_mapping = '<Leader>*'

+ 4 - 1
lua/nv-globals.lua

@@ -4,7 +4,10 @@ O = {
     colorscheme = 'nvcode',
     relative_number = true,
     shell = 'bash',
-    db_ui_save_location = '~/.config/nvcode_db',
+    database = {
+        save_location = '~/.config/nvcode_db',
+        auto_execute = 1
+    },
     python = {
         linter = '',
         -- @usage can be 'yapf', 'black'

+ 3 - 0
lua/plugins.lua

@@ -118,6 +118,9 @@ return require('packer').startup(function(use)
     use 'kristijanhusak/vim-dadbod-ui'
     use 'kristijanhusak/vim-dadbod-completion'
 
+    -- Documentation Generator 
+    use {'kkoomen/vim-doge', run = ':call doge#install()'}
+
     -- TODO put this back when stable for indent lines
     -- vim.g.indent_blankline_space_char = ''
     -- use 'b3nj5m1n/kommentary'

+ 10 - 0
vimscript/nv-whichkey/init.vim

@@ -32,6 +32,7 @@ let g:which_key_map['h'] = [ '<C-W>s'                                          ,
 let g:which_key_map['M'] = [ ':MarkdownPreviewToggle'                          , 'markdown preview']
 let g:which_key_map['h'] = [ ':let @/ = ""'                                    , 'no highlight' ]
 let g:which_key_map['r'] = [ ':RnvimrToggle'                                   , 'ranger' ]
+let g:which_key_map['*'] = [ ':DogeGenerate'                                   , 'documentation generator' ]
 " TODO create entire treesitter section
 let g:which_key_map['T'] = [ ':TSHighlightCapturesUnderCursor'                 , 'treesitter highlight' ]
 let g:which_key_map['v'] = [ '<C-W>v'                                          , 'split right']
@@ -100,6 +101,15 @@ let g:which_key_map.d = {
       " \ 'O' : ['DebugStepOut'                  , 'next-buffer'],
       " \ 'S' : ['DebugGetSession '              , 'fzf-buffer'],
 
+" D is for database
+let g:which_key_map.D = {
+      \ 'name' : '+database' ,
+      \ 'u' : ['DBUIToggle '        , 'db ui toggle'],
+      \ 'f' : ['DBUIFindBuffer'     , 'db find buffer'],
+      \ 'r' : ['DBUIRenameBuffer'   , 'db rename buffer'],
+      \ 'l' : ['DBUILastQueryInfo'  , 'db last query'],
+      \ }
+
 
 " F is for fold
 let g:which_key_map.F = {