summaryrefslogtreecommitdiff
path: root/.config/nvim/other
diff options
context:
space:
mode:
authorVikas Kushwaha <dev@vikas.rocks>2025-02-22 10:11:38 +0530
committerVikas Kushwaha <dev@vikas.rocks>2025-02-22 10:11:38 +0530
commit3b887240d1d9189be7f4adf75f3e71277b7ca833 (patch)
tree358fd67ad202c410e1730ed811647251543c553a /.config/nvim/other
parent4bba9a51b63863317983faba3988c8a14e722c11 (diff)
after fixing some boot problems
Diffstat (limited to '.config/nvim/other')
-rw-r--r--.config/nvim/other/fzf.vim4
-rw-r--r--.config/nvim/other/out.vim36
2 files changed, 38 insertions, 2 deletions
diff --git a/.config/nvim/other/fzf.vim b/.config/nvim/other/fzf.vim
index 32cb18b..371b680 100644
--- a/.config/nvim/other/fzf.vim
+++ b/.config/nvim/other/fzf.vim
@@ -14,6 +14,6 @@ imap <c-x><c-f> <plug>(fzf-complete-path)
imap <c-x><c-l> <plug>(fzf-complete-line)
" Fzf keybindings
-nnoremap <leader>ff :Files<CR>
-nnoremap <leader>. :Files %:p:h<CR>
+nnoremap <leader>ff :Files<CR>
+nnoremap <leader>f. :Files %:p:h<CR>
diff --git a/.config/nvim/other/out.vim b/.config/nvim/other/out.vim
new file mode 100644
index 0000000..6e4e1f1
--- /dev/null
+++ b/.config/nvim/other/out.vim
@@ -0,0 +1,36 @@
+" capture (dump) the (somewhat long) ouput of the commands like `:digraph`, `:map', `:highlight`, `:scripnames` etc.
+
+function! s:dump(cmd) abort
+
+ " Start a new split or maybe a buffer or a tab
+ " enew | " open a new buffer
+ 10split | enew | " open a new split (with 10% height (?))
+ " tabnew | " open a new tab
+
+ " Make it a scratch buffer ( `:help special-buffers`)
+ setlocal
+ \ bufhidden=wipe
+ \ buftype=nofile
+ \ nobuflisted
+ \ nolist
+ \ noswapfile
+ \ norelativenumber
+ \ nonumber
+
+ " Write the cmd output to the buffer
+ put =execute(a:cmd)
+ " There are 2 empty line at the beginning of the buffer before the ouput of
+ " the cmd. Not sure from where they are comning from. Anyhow I will delete
+ " them.
+ norm gg2dd
+
+ " No modifications to this buffer
+ setlocal readonly nomodifiable nomodified
+
+ " Press escape to close when you're done
+ nnoremap <buffer><silent> <Esc> :bd<CR>
+
+endfunction
+
+" Define a command to use the function easier
+command! -nargs=1 Dump execute "call s:dump(" string(<q-args>) ")"