diff --git a/.vim/pack/plugins/opt/vim-copilot/doc/tags b/.vim/pack/plugins/opt/vim-copilot/doc/tags new file mode 100644 index 0000000..91efc5b --- /dev/null +++ b/.vim/pack/plugins/opt/vim-copilot/doc/tags @@ -0,0 +1,27 @@ +:Copilot copilot.txt /*:Copilot* +:Copilot_disable copilot.txt /*:Copilot_disable* +:Copilot_enable copilot.txt /*:Copilot_enable* +:Copilot_feedback copilot.txt /*:Copilot_feedback* +:Copilot_panel copilot.txt /*:Copilot_panel* +:Copilot_setup copilot.txt /*:Copilot_setup* +:Copilot_signout copilot.txt /*:Copilot_signout* +:Copilot_status copilot.txt /*:Copilot_status* +:Copilot_version copilot.txt /*:Copilot_version* +b:copilot_enabled copilot.txt /*b:copilot_enabled* +copilot copilot.txt /*copilot* +copilot#Accept() copilot.txt /*copilot#Accept()* +copilot-highlighting copilot.txt /*copilot-highlighting* +copilot-i_ copilot.txt /*copilot-i_* +copilot-i_ALT-CTRL-Right copilot.txt /*copilot-i_ALT-CTRL-Right* +copilot-i_ALT-Right copilot.txt /*copilot-i_ALT-Right* +copilot-i_ALT-[ copilot.txt /*copilot-i_ALT-[* +copilot-i_ALT-\ copilot.txt /*copilot-i_ALT-\\* +copilot-i_ALT-] copilot.txt /*copilot-i_ALT-]* +copilot-i_CTRL-] copilot.txt /*copilot-i_CTRL-]* +copilot-maps copilot.txt /*copilot-maps* +copilot-options copilot.txt /*copilot-options* +copilot.txt copilot.txt /*copilot.txt* +g:copilot_filetypes copilot.txt /*g:copilot_filetypes* +g:copilot_node_command copilot.txt /*g:copilot_node_command* +g:copilot_proxy copilot.txt /*g:copilot_proxy* +g:copilot_proxy_strict_ssl copilot.txt /*g:copilot_proxy_strict_ssl* diff --git a/.vim/pack/plugins/start/vim-fzf-cscope/LICENSE b/.vim/pack/plugins/start/vim-fzf-cscope/LICENSE new file mode 100644 index 0000000..6f13c10 --- /dev/null +++ b/.vim/pack/plugins/start/vim-fzf-cscope/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Nabendu Maiti + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.vim/pack/plugins/start/vim-fzf-cscope/README.md b/.vim/pack/plugins/start/vim-fzf-cscope/README.md new file mode 100755 index 0000000..b4f97a9 --- /dev/null +++ b/.vim/pack/plugins/start/vim-fzf-cscope/README.md @@ -0,0 +1,78 @@ +# fzf_cscope.vim + + CSCOPE settings for vim using popup and preview window +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +![image-20210314031215254](https://raw.githubusercontent.com/nmaiti/fzf_cscope.vim/master/screenshoot.png) + + + + + + This file contains settings for vim's cscope interface to fzf (can use vim* >8 advanced popup feature), " plus some keyboard mappings that I've found useful. + +### Prerequisites : + +1. cscope -- install using 'sudo apt install cscope' on ubuntu +2. https://github.com/junegunn/fzf +3. https://github.com/junegunn/fzf.vim + +### Installation: + +Install fzf & fzf.vim before installing fzf_csope.vim and using it + +`Using` [pathogen.vim](https://github.com/tpope/vim-pathogen), and then simply copy and paste: + +```sh +mkdir -p ~/.vim/bundle +cd ~/.vim/bundle +git clone https://github.com/nmaiti/fzf_cscope.vim.git +``` + +using [vim Plug](https://github.com/junegunn/vim-plug) add following in your ~/.vimrc + +```sh +Plug 'nmaiti/fzf_cscope.vim' +``` + +### **key mappings** + +Search options - +```sh +'s' symbol: find all references to the token under cursor. +'g' global: find global definition(s) of the token under cursor +'c' calls: find all calls to the function name under cursor. +'t' text: find all instances of the text under cursor. +'e' egrep: egrep search for the word under cursor. +'f' file: open the filename under cursor. +'i' includes: find files that include the filename under cursor. +'d' called: find functions that function under cursor calls. +'a' Assigned: Assigned to this symbol. +``` + +```shell +k ------- search word/file under the current cursor +e.g.sc +kc - find callers of current keyword/symbol +``` + +// Interactive cscope search + +```sh +k ------- search something +e.g. +ks - find symbol +``` + +**NOTE**: + +1. These key maps use multiple keystrokes (2 or 3 keys). If you find that vim + " keeps timing you out before you can complete them, try changing your timeout + " settings, as explained below +2. cscope_map.vim can also be used independently with it's own key mappings. If not csope_maps.vim is not present fzf_cscope.vim can use csope_maps.vim's keyboard shortcuts for convenience of programmers. + In that case instead of 'k', '' can be used. + + **Self promotion**: + + Try [zsh_vim config](https://github.com/nmaiti/zsh-vim-config/tree/to_plug) to_plug branch for latest vim features and plugins + diff --git a/.vim/pack/plugins/start/vim-fzf-cscope/plugin/fzf_csope.vim b/.vim/pack/plugins/start/vim-fzf-cscope/plugin/fzf_csope.vim new file mode 100755 index 0000000..8e13a54 --- /dev/null +++ b/.vim/pack/plugins/start/vim-fzf-cscope/plugin/fzf_csope.vim @@ -0,0 +1,118 @@ +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" CSCOPE settings for vim using popup and preview window +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" This file contains fzf shortcut for vim's cscope interface, +" with keyboard mappings. +" Prerequiites +" USAGE: +" -- vim 6: Stick this file in your ~/.vim/plugin directory (or in a +" 'plugin' directory in some other directory that is in your +" 'runtimepath'. +" +" NOTE: +" These key maps use multiple keystrokes (2 or 3 keys). If you find that vim +" keeps timing you out before you can complete them, try changing your timeout +" settings, as explained below. +" +" Happy cscoping, +" +" Nabendu Maiti nbmaiti83@gmail.com 2021/3/14 +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +function! Cscope(option, query, fullscreen) + let color = '{ x = $1; $1 = ""; z = $3; $3 = ""; p = $2; $2 = ""; printf "\033[35m%s\033[0m:\033[32m%s\033[0m:\033[33;1m%s\033[0m:\033[34m%s\033[0m\n", x,z,p,$0;}' + let command_fmt = "cscope -dL -%s %s %s %s '" + + let initial_command = printf(command_fmt, a:option, shellescape(a:query)," | awk '", color) + let reload_command = printf(command_fmt, a:option, '{q}', " | awk '", color) + let spec = {'options': ['--phony', '--query', a:query, '--bind', 'change:reload:'.reload_command]} + call fzf#vim#grep(initial_command, 0, fzf#vim#with_preview(spec), a:fullscreen) +endfunction + +function! CscopeQuery(option) + call inputsave() + if a:option == '0' + let query = input('C Symbol: ') + elseif a:option == '1' + let query = input('Definition: ') + elseif a:option == '2' + let query = input('Functions calling: ') + elseif a:option == '3' + let query = input('Functions called by: ') + elseif a:option == '4' + let query = input('Text: ') + elseif a:option == '6' + let query = input('Egrep: ') + elseif a:option == '7' + let query = input('File: ') + elseif a:option == '8' + let query = input('Files #including: ') + elseif a:option == '9' + let query = input('Assignments to: ') + else + echo "Invalid option!" + return + endif + call inputrestore() + if query != "" + call Cscope(a:option, query , 0) + else + echom "Cancelled Search!" + endif +endfunction + +if mapcheck('g') == "" + "'s' symbol: find all references to the token under cursor + "'g' global: find global definition(s) of the token under cursor + "'c' calls: find all calls to the function name under cursor + "'t' text: find all instances of the text under cursor + "'e' egrep: egrep search for the word under cursor + "'f' file: open the filename under cursor + "'i' includes: find files that include the filename under cursor + "'d' called: find functions that function under cursor calls + "'a' Assigned: Assigned to this symbol + + nnoremap s :call Cscope('0', expand(''), 0) + nnoremap g :call Cscope('1', expand(''), 0) + nnoremap d :call Cscope('2', expand(''), 0) + nnoremap c :call Cscope('3', expand(''), 0) + nnoremap t :call Cscope('4', expand(''), 0) + nnoremap e :call Cscope('6', expand(''), 0) + nnoremap f :call Cscope('7', expand(''), 0) + nnoremap i :call Cscope('8', expand(''), 0) + nnoremap a :call Cscope('9', expand(''), 0) + + nnoremap s :call CscopeQuery('0') + nnoremap g :call CscopeQuery('1') + nnoremap d :call CscopeQuery('2') + nnoremap c :call CscopeQuery('3') + nnoremap t :call CscopeQuery('4') + nnoremap e :call CscopeQuery('6') + nnoremap f :call CscopeQuery('7') + nnoremap i :call CscopeQuery('8') + nnoremap a :call CscopeQuery('9') +endif + +" default and permanent key apping +nnoremap ks :call Cscope('0', expand(''), 0) +nnoremap kg :call Cscope('1', expand(''), 0) +nnoremap kd :call Cscope('2', expand(''), 0) +nnoremap kc :call Cscope('3', expand(''), 0) +nnoremap kt :call Cscope('4', expand(''), 0) +nnoremap ke :call Cscope('6', expand(''), 0) +nnoremap kf :call Cscope('7', expand(''), 0) +nnoremap ki :call Cscope('8', expand(''), 0) +nnoremap ka :call Cscope('9', expand(''), 0) + +nnoremap ks :call CscopeQuery('0') +nnoremap kg :call CscopeQuery('1') +nnoremap kd :call CscopeQuery('2') +nnoremap kc :call CscopeQuery('3') +nnoremap kt :call CscopeQuery('4') +nnoremap ke :call CscopeQuery('6') +nnoremap kf :call CscopeQuery('7') +nnoremap ki :call CscopeQuery('8') +nnoremap ka :call CscopeQuery('9') + + diff --git a/.vim/pack/plugins/start/vim-fzf-cscope/screenshoot.png b/.vim/pack/plugins/start/vim-fzf-cscope/screenshoot.png new file mode 100755 index 0000000..deffe39 Binary files /dev/null and b/.vim/pack/plugins/start/vim-fzf-cscope/screenshoot.png differ diff --git a/.vim/pack/plugins/start/vim-sxhkdrc/README.md b/.vim/pack/plugins/start/vim-sxhkdrc/README.md new file mode 100644 index 0000000..0e71a7c --- /dev/null +++ b/.vim/pack/plugins/start/vim-sxhkdrc/README.md @@ -0,0 +1 @@ +Original author: [Steven Allen](https://github.com/Stebalien). diff --git a/.vim/pack/plugins/start/vim-sxhkdrc/ftdetect/sxhkdrc.vim b/.vim/pack/plugins/start/vim-sxhkdrc/ftdetect/sxhkdrc.vim new file mode 100644 index 0000000..4f49476 --- /dev/null +++ b/.vim/pack/plugins/start/vim-sxhkdrc/ftdetect/sxhkdrc.vim @@ -0,0 +1,5 @@ +if &compatible || v:version < 603 + finish +endif + +autocmd BufNewFile,BufRead sxhkdrc,*.sxhkdrc set ft=sxhkdrc diff --git a/.vim/pack/plugins/start/vim-sxhkdrc/ftplugin/sxhkdrc.vim b/.vim/pack/plugins/start/vim-sxhkdrc/ftplugin/sxhkdrc.vim new file mode 100644 index 0000000..b63baa1 --- /dev/null +++ b/.vim/pack/plugins/start/vim-sxhkdrc/ftplugin/sxhkdrc.vim @@ -0,0 +1,11 @@ +if exists("b:did_ftplugin") + finish +endif + +setlocal cms=#%s + +if exists('b:undo_ftplugin') + let b:undo_ftplugin .= "|setlocal commentstring<" +else + let b:undo_ftplugin = "setlocal commentstring<" +endif diff --git a/.vim/pack/plugins/start/vim-sxhkdrc/syntax/sxhkdrc.vim b/.vim/pack/plugins/start/vim-sxhkdrc/syntax/sxhkdrc.vim new file mode 100644 index 0000000..72e0388 --- /dev/null +++ b/.vim/pack/plugins/start/vim-sxhkdrc/syntax/sxhkdrc.vim @@ -0,0 +1,26 @@ +if exists("b:current_syntax") + finish +endif + +syntax include @Shell syntax/sh.vim + +syn match sxComment "^#.*$" +syn match sxHotkey "[^ #].*" contains=sxKeysym,sxModifier,sxHotkeySep,sxSequence +syn match sxCommand "^\s.*$" containedin=ALL contains=@Shell,sxSequenceShell +syn keyword sxModifier super hyper meta alt control ctrl shift mode_switch lock mod1 mod2 mod3 mod4 mod5 any contained +syn match sxKeysym "[^ :;{,}+-]\+" contained contains=sxAction +syn match sxAction "[@~/]" contained +syn match sxHotkeySep "[;:+]" contained +syn match sxSequenceSep "[,-]" contained +syn region sxSequence matchgroup=sxBrace start=/{/ end=/}/ contained keepend oneline contains=sxKeysym,sxModifier,sxHotkeySep,sxSequenceSep +syn region sxSequenceShell matchgroup=sxBrace start=/{/ end=/}/ contained keepend oneline contains=sxKeysym,sxSequenceSep + +hi def link sxComment Comment +hi def link sxModifier Keyword +hi def link sxKeysym Identifier +hi def link sxAction Special +hi def link sxBrace Special +hi def link sxHotkeySep Delimiter +hi def link sxSequenceSep Delimiter + +let b:current_syntax = "sxhkdrc"