diff --git a/config/.config/nvim/lua/treesitter.lua b/config/.config/nvim/lua/treesitter.lua index 26fdf8b..96b5a1a 100644 --- a/config/.config/nvim/lua/treesitter.lua +++ b/config/.config/nvim/lua/treesitter.lua @@ -1,6 +1,7 @@ require('nvim-treesitter.configs').setup { -- A list of parser names, or "all" - ensure_installed = { "c", "lua", "vim", "java", "kotlin"}, + -- ensure_installed = { "c", "lua", "vim", "java", "kotlin"}, + ensure_installed = "all", -- Install parsers synchronously (only applied to `ensure_installed`) sync_install = false, diff --git a/vim/.vim/prefs/fzf.vim b/vim/.vim/prefs/fzf.vim index 1481981..9ad65c4 100644 --- a/vim/.vim/prefs/fzf.vim +++ b/vim/.vim/prefs/fzf.vim @@ -12,7 +12,8 @@ let g:fzf_command_prefix = 'Fzf' " use the same keybindings for fzf as in shell " nnoremap :FzfHgFiles " nnoremap :FzfHgRg -let s:hg_command = 'hg whatsout --template= -- 2>/dev/null' +let s:hg_command = 'hg pstatus -ma -n --template= -- 2>/dev/null' +let s:rg_command = 'rg --ignore-case --hidden --follow --color auto --line-number' command! -bang FzfHgFiles \ call fzf#run(fzf#wrap({ @@ -20,7 +21,7 @@ command! -bang FzfHgFiles \ }), \ 0 \ ) -command! -bang -nargs=* FzfHgRg +command! -bang -nargs=* ClSearch \ call fzf#vim#grep( \ s:rg_command . " " . . " " . "$(" . s:hg_command . ")", 1, \ 0 ? fzf#vim#with_preview('up:60%') diff --git a/vim/.vim/prefs/google_comments.vim b/vim/.vim/prefs/google_comments.vim index 7188b9c..afa9920 100644 --- a/vim/.vim/prefs/google_comments.vim +++ b/vim/.vim/prefs/google_comments.vim @@ -3,6 +3,7 @@ lua << EOF require('google.comments').setup { -- The command for fetching comments, refer to `get_comments.par --help` to -- see all the options. + -- command = {'/google/bin/releases/editor-devtools/get_comments.par', '--full', '--json', "-x=''"}, command = {'/google/bin/releases/editor-devtools/get_comments.par', '--json', '--full', '--noresolved', '--cl_comments', '--file_comments', ' -x ""'}, -- Define your own icon by `vim.fn.sign_define('ICON_NAME', {text = ' '})`. -- See :help sign_define @@ -17,6 +18,11 @@ require('google.comments').setup { -- When showing file paths, use relative paths or not. relative_path = true, }, + --- Enable viewing comments through floating window + floating = true, + --- Options used when creating the floating window. + floating_window_options = require('google.comments.options') + .default_floating_window_options, } -- here are some mappings you might want: vim.api.nvim_set_keymap('n', 'nc', @@ -36,3 +42,4 @@ vim.fn.sign_define('COMMENT_ICON', {text = ''}) EOF autocmd InsertLeave * :lua require('google.comments').update_signs() +autocmd InsertLeave * :GoogleCommentsFetchComments diff --git a/vim/.vim/prefs/imp.vim b/vim/.vim/prefs/imp.vim index cb6422b..1db1a43 100644 --- a/vim/.vim/prefs/imp.vim +++ b/vim/.vim/prefs/imp.vim @@ -1,5 +1,3 @@ -source ~/.vim/prefs/google_comments.vim - set runtimepath+=/google/src/files/head/depot/google3/experimental/users/tstone/vim/vim-imp set runtimepath+=/google/src/files/head/depot/google3/experimental/users/tstone/vim/imp-csearch diff --git a/vim/.vim/prefs/leader.vim b/vim/.vim/prefs/leader.vim index eda7ba5..0fc61ed 100644 --- a/vim/.vim/prefs/leader.vim +++ b/vim/.vim/prefs/leader.vim @@ -29,9 +29,10 @@ vmap v c"+p imap v "+pa " Copy to OS clipboard - " vnoremap y "yy :call system('xclip', @y) -map y !xclip -selection clipboard -vmap y !xclip -selection clipboard +vnoremap y "yy :call system('xclip', @y) +map y "yy :call system('xclip', @y) +" map y !xclip -selection clipboard +" vmap y !xclip -selection clipboard " map y "+Y " vmap y "+y @@ -96,7 +97,7 @@ let g:NERDCommentEmptyLines = 1 " Enable trimming of trailing whitespace when uncommenting let g:NERDTrimTrailingWhitespace = 1 - "Enable NERDCommenterToggle to check all selected lines is commented or not +"Enable NERDCommenterToggle to check all selected lines is commented or not let g:NERDToggleCheckAllLines = 1 nnoremap c :call nerdcommenter#Comment(0,"toggle") @@ -112,3 +113,5 @@ nmap e :e %% " replace currently selected text with default register " without yanking it vnoremap p "_dP + +nnoremap rp :VimuxOpenRunner :VimuxRunCommand '!!' :call VimuxSendKeys("Enter") diff --git a/vim/.vim/prefs/plug_prefs.vim b/vim/.vim/prefs/plug_prefs.vim deleted file mode 100644 index 680e3cc..0000000 --- a/vim/.vim/prefs/plug_prefs.vim +++ /dev/null @@ -1,7 +0,0 @@ -" ONE LINERS ONLY -" set statusline+=%#warningmsg# -" set statusline+=%{SyntasticStatuslineFlag()} -" set statusline+=%* -set statusline=%{pathshorten(expand('%:f'))} - -let g:rainbow_active = 1 "set to 0 if you want to enable it later via :RainbowToggle diff --git a/vim/.vim/prefs/plugins.vim b/vim/.vim/prefs/plugins.vim index 693369a..47b1eb4 100644 --- a/vim/.vim/prefs/plugins.vim +++ b/vim/.vim/prefs/plugins.vim @@ -43,8 +43,7 @@ Plug 'junegunn/gv.vim' " git commit browser Plug 'tpope/vim-git' Plug 'airblade/vim-gitgutter' " live git diff gutter Plug 'tmux-plugins/vim-tmux' " tmux -Plug 'benmills/vimux' -Plug 'nvim-lua/plenary.nvim' +Plug 'preservim/vimux' Plug 'christoomey/vim-tmux-navigator' " tmux Plug 'ferrine/md-img-paste.vim' " copy-paste images to markdown Plug 'junegunn/vim-easy-align' " markdown table aligns @@ -127,3 +126,8 @@ Plug 'kristiandupont/shades-of-teal' Plug 'joshdick/onedark.vim' Plug 'google/vim-colorscheme-primary' Plug 'kyoz/purify', { 'rtp': 'vim' } + +" ONE LINERS ONLY +set statusline=%{pathshorten(expand('%:f'))} + +let g:rainbow_active = 1 "set to 0 if you want to enable it later via :RainbowToggle diff --git a/vim/.vimrc b/vim/.vimrc index 044349f..9f31853 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -89,7 +89,6 @@ call plug#begin('~/.vim/plugged') source ~/.vim/prefs/mappings.vim source ~/.vim/prefs/leader.vim - source ~/.vim/prefs/plug_prefs.vim source ~/.vim/prefs/ui.vim source ~/.vim/prefs/golang.vim source ~/.vim/prefs/ultisnips.vim @@ -115,6 +114,7 @@ EOF if filereadable(expand("~/use_google")) source ~/.vim/prefs/cmp.vim source ~/.vim/prefs/imp.vim + source ~/.vim/prefs/google_comments.vim endif filetype plugin on " redundant? diff --git a/zsh/.aliases.sh b/zsh/.aliases.sh index 14ecac8..02f3eee 100644 --- a/zsh/.aliases.sh +++ b/zsh/.aliases.sh @@ -89,7 +89,12 @@ get_current_activity() { } cl_search() { - hg status -n --change . --template= | xargs -i sh -c "echo {} && grep '$1' {}" + # hg status -n --change . --template= | xargs -i sh -c "echo {} && grep '$1' {}" + rg --ignore-case $1 $(hg pstatus -ma -n --template= -- 2>/dev/null) +} + +todos() { + cl_search "TODO" } cl_replace() {