Update 2024-01-24 08:30 OpenBSD/amd64-x13

This commit is contained in:
c0dev0id 2024-01-24 08:30:52 +01:00
parent 1525e53b5d
commit 0cc8cdd9e0
9 changed files with 287 additions and 0 deletions

View File

@ -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_<Tab> copilot.txt /*copilot-i_<Tab>*
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*

View File

@ -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.

View File

@ -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
<Leader>k<search option key> ------- search word/file under the current cursor
e.g.sc
<Leader>kc - find callers of current keyword/symbol
```
// Interactive cscope search
```sh
<Leader><Leader>k<search option key> ------- search something
e.g.
<Leader><Leader>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 '<Leader>k', '<Ctrl - \>' 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

View File

@ -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('<C-\>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 <C-\>s :call Cscope('0', expand('<cword>'), 0)<CR>
nnoremap <C-\>g :call Cscope('1', expand('<cword>'), 0)<CR>
nnoremap <C-\>d :call Cscope('2', expand('<cword>'), 0)<CR>
nnoremap <C-\>c :call Cscope('3', expand('<cword>'), 0)<CR>
nnoremap <C-\>t :call Cscope('4', expand('<cword>'), 0)<CR>
nnoremap <C-\>e :call Cscope('6', expand('<cword>'), 0)<CR>
nnoremap <C-\>f :call Cscope('7', expand('<cfile>'), 0)<CR>
nnoremap <C-\>i :call Cscope('8', expand('<cfile>'), 0)<CR>
nnoremap <C-\>a :call Cscope('9', expand('<cword>'), 0)<CR>
nnoremap <C-\><C-\>s :call CscopeQuery('0')<CR>
nnoremap <C-\><C-\>g :call CscopeQuery('1')<CR>
nnoremap <C-\><C-\>d :call CscopeQuery('2')<CR>
nnoremap <C-\><C-\>c :call CscopeQuery('3')<CR>
nnoremap <C-\><C-\>t :call CscopeQuery('4')<CR>
nnoremap <C-\><C-\>e :call CscopeQuery('6')<CR>
nnoremap <C-\><C-\>f :call CscopeQuery('7')<CR>
nnoremap <C-\><C-\>i :call CscopeQuery('8')<CR>
nnoremap <C-\><C-\>a :call CscopeQuery('9')<CR>
endif
" default and permanent key apping
nnoremap <silent> <Leader>ks :call Cscope('0', expand('<cword>'), 0)<CR>
nnoremap <silent> <Leader>kg :call Cscope('1', expand('<cword>'), 0)<CR>
nnoremap <silent> <Leader>kd :call Cscope('2', expand('<cword>'), 0)<CR>
nnoremap <silent> <Leader>kc :call Cscope('3', expand('<cword>'), 0)<CR>
nnoremap <silent> <Leader>kt :call Cscope('4', expand('<cword>'), 0)<CR>
nnoremap <silent> <Leader>ke :call Cscope('6', expand('<cword>'), 0)<CR>
nnoremap <silent> <Leader>kf :call Cscope('7', expand('<cword>'), 0)<CR>
nnoremap <silent> <Leader>ki :call Cscope('8', expand('<cword>'), 0)<CR>
nnoremap <silent> <Leader>ka :call Cscope('9', expand('<cword>'), 0)<CR>
nnoremap <silent> <Leader><Leader>ks :call CscopeQuery('0')<CR>
nnoremap <silent> <Leader><Leader>kg :call CscopeQuery('1')<CR>
nnoremap <silent> <Leader><Leader>kd :call CscopeQuery('2')<CR>
nnoremap <silent> <Leader><Leader>kc :call CscopeQuery('3')<CR>
nnoremap <silent> <Leader><Leader>kt :call CscopeQuery('4')<CR>
nnoremap <silent> <Leader><Leader>ke :call CscopeQuery('6')<CR>
nnoremap <silent> <Leader><Leader>kf :call CscopeQuery('7')<CR>
nnoremap <silent> <Leader><Leader>ki :call CscopeQuery('8')<CR>
nnoremap <silent> <Leader><Leader>ka :call CscopeQuery('9')<CR>

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

View File

@ -0,0 +1 @@
Original author: [Steven Allen](https://github.com/Stebalien).

View File

@ -0,0 +1,5 @@
if &compatible || v:version < 603
finish
endif
autocmd BufNewFile,BufRead sxhkdrc,*.sxhkdrc set ft=sxhkdrc

View File

@ -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

View File

@ -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"