From d1c7fff02586ee447d8c36d47c037436a6f25f80 Mon Sep 17 00:00:00 2001 From: srdusr Date: Thu, 9 Feb 2023 13:54:53 +0200 Subject: Commented out all lines :TODO Move all functions to either utils.vim or utils.lua --- lua/user/mods.lua | 184 +++++++++++++++++++++++++++--------------------------- 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/lua/user/mods.lua b/lua/user/mods.lua index ec77173..c36d9e2 100644 --- a/lua/user/mods.lua +++ b/lua/user/mods.lua @@ -26,98 +26,98 @@ -- endif --]]) -vim.cmd([[ - let g:fzf_history_dir = '~/.local/share/fzf-history' - map z :FZF - map a :Files - map l :Lines - map L :BLines - map B :Buffers - map h :History: - nnoremap g :Rg - "nnoremap t :Tags - nnoremap m :Marks - " This is the default extra key bindings - let g:fzf_action = { - \ 'ctrl-t': 'tab split', - \ 'ctrl-x': 'split', - \ 'ctrl-y': 'vsplit' } - let g:fzf_tags_command = 'ctags -R' - " Border color - let g:fzf_layout = {'up':'~90%', 'window': { 'width': 0.8, 'height': 0.8,'yoffset':0.5,'xoffset': 0.5, 'highlight': 'Todo', 'border': 'sharp' } } - let $FZF_DEFAULT_OPTS = '--layout=reverse --info=inline' - let $FZF_DEFAULT_COMMAND="rg --files --hidden" - " Customize fzf colors to match your color scheme - let g:fzf_colors = - \ { 'fg': ['fg', 'Normal'], - \ 'bg': ['bg', 'Normal'], - \ 'hl': ['fg', 'Comment'], - \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'], - \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'], - \ 'hl+': ['fg', 'Statement'], - \ 'info': ['fg', 'PreProc'], - \ 'border': ['fg', 'Ignore'], - \ 'prompt': ['fg', 'Conditional'], - \ 'pointer': ['fg', 'Exception'], - \ 'marker': ['fg', 'Keyword'], - \ 'spinner': ['fg', 'Label'], - \ 'header': ['fg', 'Comment'] } - " Get Files - command! -bang -nargs=? -complete=dir Files - \ call fzf#vim#files(, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline']}), 0) - " Get text in files with Rg - command! -bang -nargs=* Rg - \ call fzf#vim#grep( - \ 'rg --column --line-number --no-heading --color=always --smart-case '.shellescape(), 1, - \ fzf#vim#with_preview(), 0) - " Ripgrep advanced - function! RipgrepFzf(query, fullscreen) - let command_fmt = 'rg --column --line-number --no-heading --color=always --smart-case %s || true' - let initial_command = printf(command_fmt, shellescape(a:query)) - let reload_command = printf(command_fmt, '{q}') - let spec = {'options': ['--phony', '--query', a:query, '--bind', 'change:reload:'.reload_command]} - call fzf#vim#grep(initial_command, 1, fzf#vim#with_preview(spec), a:fullscreen) - endfunction - command! -nargs=* -bang RG call RipgrepFzf(, 0) - " Git grep - command! -bang -nargs=* GGrep - \ call fzf#vim#grep( - \ 'git grep --line-number '.shellescape(), 0, - \ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), 0) - command! -bang FM call fzf#run(fzf#wrap({'source': 'cat ~/.fzf-marks | sed "s/.*: \(.*\)$/\1/" | sed "s#~#${HOME}#"', 'sink': 'lcd'}, 0)) -]]) - -vim.cmd([[ - " Enable mouse scrollback - set mouse=a - tnoremap - tnoremap - function! ClearTerminal() - set scrollback=1 - let &g:scrollback=1 - echo &scrollback - call feedkeys("\i") - call feedkeys("clear\") - call feedkeys("\\") - call feedkeys("\i") - sleep 100m - let &scrollback=s:scroll_value - endfunction -]]) - -vim.cmd([[ - " :Rename {newname} - function! RenameFile() - let old_name = expand('%') - let new_name = input('New file name: ', expand('%'), 'file') - if new_name != '' && new_name != old_name - exec ':saveas ' . new_name - exec ':silent !rm ' . old_name - redraw! - endif - endfunction - map re :call RenameFile() -]]) +--vim.cmd([[ +-- let g:fzf_history_dir = '~/.local/share/fzf-history' +-- map z :FZF +-- map a :Files +-- map l :Lines +-- map L :BLines +-- map B :Buffers +-- map h :History: +-- nnoremap g :Rg +-- "nnoremap t :Tags +-- nnoremap m :Marks +-- " This is the default extra key bindings +-- let g:fzf_action = { +-- \ 'ctrl-t': 'tab split', +-- \ 'ctrl-x': 'split', +-- \ 'ctrl-y': 'vsplit' } +-- let g:fzf_tags_command = 'ctags -R' +-- " Border color +-- let g:fzf_layout = {'up':'~90%', 'window': { 'width': 0.8, 'height': 0.8,'yoffset':0.5,'xoffset': 0.5, 'highlight': 'Todo', 'border': 'sharp' } } +-- let $FZF_DEFAULT_OPTS = '--layout=reverse --info=inline' +-- let $FZF_DEFAULT_COMMAND="rg --files --hidden" +-- " Customize fzf colors to match your color scheme +-- let g:fzf_colors = +-- \ { 'fg': ['fg', 'Normal'], +-- \ 'bg': ['bg', 'Normal'], +-- \ 'hl': ['fg', 'Comment'], +-- \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'], +-- \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'], +-- \ 'hl+': ['fg', 'Statement'], +-- \ 'info': ['fg', 'PreProc'], +-- \ 'border': ['fg', 'Ignore'], +-- \ 'prompt': ['fg', 'Conditional'], +-- \ 'pointer': ['fg', 'Exception'], +-- \ 'marker': ['fg', 'Keyword'], +-- \ 'spinner': ['fg', 'Label'], +-- \ 'header': ['fg', 'Comment'] } +-- " Get Files +-- command! -bang -nargs=? -complete=dir Files +-- \ call fzf#vim#files(, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline']}), 0) +-- " Get text in files with Rg +-- command! -bang -nargs=* Rg +-- \ call fzf#vim#grep( +-- \ 'rg --column --line-number --no-heading --color=always --smart-case '.shellescape(), 1, +-- \ fzf#vim#with_preview(), 0) +-- " Ripgrep advanced +-- function! RipgrepFzf(query, fullscreen) +-- let command_fmt = 'rg --column --line-number --no-heading --color=always --smart-case %s || true' +-- let initial_command = printf(command_fmt, shellescape(a:query)) +-- let reload_command = printf(command_fmt, '{q}') +-- let spec = {'options': ['--phony', '--query', a:query, '--bind', 'change:reload:'.reload_command]} +-- call fzf#vim#grep(initial_command, 1, fzf#vim#with_preview(spec), a:fullscreen) +-- endfunction +-- command! -nargs=* -bang RG call RipgrepFzf(, 0) +-- " Git grep +-- command! -bang -nargs=* GGrep +-- \ call fzf#vim#grep( +-- \ 'git grep --line-number '.shellescape(), 0, +-- \ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), 0) +-- command! -bang FM call fzf#run(fzf#wrap({'source': 'cat ~/.fzf-marks | sed "s/.*: \(.*\)$/\1/" | sed "s#~#${HOME}#"', 'sink': 'lcd'}, 0)) +--]]) +-- +--vim.cmd([[ +-- " Enable mouse scrollback +-- set mouse=a +-- tnoremap +-- tnoremap +-- function! ClearTerminal() +-- set scrollback=1 +-- let &g:scrollback=1 +-- echo &scrollback +-- call feedkeys("\i") +-- call feedkeys("clear\") +-- call feedkeys("\\") +-- call feedkeys("\i") +-- sleep 100m +-- let &scrollback=s:scroll_value +-- endfunction +--]]) +-- +--vim.cmd([[ +-- " :Rename {newname} +-- function! RenameFile() +-- let old_name = expand('%') +-- let new_name = input('New file name: ', expand('%'), 'file') +-- if new_name != '' && new_name != old_name +-- exec ':saveas ' . new_name +-- exec ':silent !rm ' . old_name +-- redraw! +-- endif +-- endfunction +-- map re :call RenameFile() +--]]) --vim.cmd([[ -- " Markdown Settings -- cgit v1.2.3