Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-go / debug / init.vim
1 set number                              " Show: Line numbers
2 set cursorline                          " Hilight current curser line
3 set noshowmode                          " Hide: -- INSERT --
4 set listchars=tab:»\ ,extends:›,precedes:‹,nbsp:·,space:·,trail:·
5 set list                                " Show white space
6 set tabstop=2
7 set shiftwidth=2
8 set expandtab
9 set nowrap
10 set colorcolumn=80,120
11 set mouse=a
12 " set clipboard+=unnamedplus
13 set nobackup
14 set noswapfile
15 set undodir=~/.config/nvim/undo
16 set undofile
17 set conceallevel=0
18 autocmd BufEnter * if &filetype != 'nerdtree' &&  &filetype != 'help' | set conceallevel=0 | endif
19 set cmdheight=1
20 set shortmess+=c
21 set signcolumn=yes
22 set updatetime=300
23 set hidden
24 set spell spelllang=en_us,de_de
25 set splitbelow
26 set splitright
27 highlight clear CocHighlightText
28 highlight CocHighlightText cterm=underline gui=underline
29 set hlsearch            " Highlight search results.
30 set ignorecase          " Make searching case insensitive
31 set smartcase           " ... unless the query has capital letters.
32 set incsearch           " Incremental search.
33 set gdefault            " Use 'g' flag by default with :s/foo/bar/.
34 set magic               " Use 'magic' patterns (extended regular expressions).
35 set nofoldenable        " Never fold (by defauld, override for sim languages)
36 set inccommand=split
37
38 exec 'set wildignore=' . join([
39   \   '.sass-cache',
40   \   '\.DS_Store',
41   \   '\.git$',
42   \   '\~$',
43   \   '\.swp$',
44   \   'gin-bin',
45   \   '*/node_modules/*',
46   \ ], ',')
47
48 set noautochdir
49 set signcolumn=yes
50 set autoread
51
52 let &scrolloff = 4
53 if exists('##CompleteChanged') && exists('*nvim_open_win')
54   set pumblend=10
55   set wildoptions=pum
56 endif
57
58
59 let mapleader=","
60 let maplocalleader = "-"
61 "
62 " select tabs
63 nnoremap <silent><Tab>      :tabnext<CR>
64 nnoremap <silent><S-Tab>    :tabprevious<CR>
65
66 " move tabs
67 nnoremap <silent>m<Tab>     :tabm +1<CR>
68 nnoremap <silent>m<S-Tab>   :tabm -1<CR>
69 " open and close tabs
70 " nnoremap <silent><C-t>      :tabnew<CR>
71 nnoremap <silent><C-q>      :quit<CR>
72
73 nnoremap <silent><C-t>      :split term://zsh<CR>i
74
75
76
77
78 " Use tab for trigger completion with characters ahead and navigate.
79 " NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
80 " other plugin before putting this into your config.
81 inoremap <silent><expr> <TAB>
82       \ pumvisible() ? "\<C-n>" :
83       \ <SID>check_back_space() ? "\<TAB>" :
84       \ coc#refresh()
85 inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
86
87 function! s:check_back_space() abort
88   let col = col('.') - 1
89   return !col || getline('.')[col - 1]  =~# '\s'
90 endfunction
91
92 " Use <c-space> to trigger completion.
93 inoremap <silent><expr> <c-space> coc#refresh()
94
95 " Use <cr> to confirm completion, `<C-g>u` means break undo chain at current
96 " position. Coc only does snippet and additional edit on confirm.
97 " <cr> could be remapped by other vim plugin, try `:verbose imap <CR>`.
98 if exists('*complete_info')
99   inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
100 else
101   inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
102 endif
103
104 " Use `[g` and `]g` to navigate diagnostics
105 nmap <silent> [g <Plug>(coc-diagnostic-prev)
106 nmap <silent> ]g <Plug>(coc-diagnostic-next)
107
108 " GoTo code navigation.
109 nmap <silent> gd <Plug>(coc-definition)
110 nmap <silent> gy <Plug>(coc-type-definition)
111 nmap <silent> gi <Plug>(coc-implementation)
112 nmap <silent> gr <Plug>(coc-references)
113
114 " Use K to show documentation in preview window.
115 nnoremap <silent> K :call <SID>show_documentation()<CR>
116
117 function! s:show_documentation()
118   if (index(['vim','help'], &filetype) >= 0)
119     execute 'h '.expand('<cword>')
120   else
121     call CocAction('doHover')
122   endif
123 endfunction
124
125 " Highlight the symbol and its references when holding the cursor.
126 autocmd CursorHold * silent call CocActionAsync('highlight')
127
128
129 augroup mygroup
130   autocmd!
131   " Setup formatexpr specified filetype(s).
132   autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
133   " Update signature help on jump placeholder.
134   autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
135 augroup end
136
137 " Applying codeAction to the selected region.
138 " Example: `<leader>aap` for current paragraph
139 xmap <leader>a  <Plug>(coc-codeaction-selected)
140 nmap <leader>a  <Plug>(coc-codeaction-selected)
141
142 " Remap keys for applying codeAction to the current line.
143 nmap <leader>ac  <Plug>(coc-codeaction-line)
144 " Apply AutoFix to problem on the current line.
145 nmap <leader>qf  <Plug>(coc-fix-current)
146
147 " Introduce function text object
148 " NOTE: Requires 'textDocument.documentSymbol' support from the language server.
149 xmap if <Plug>(coc-funcobj-i)
150 xmap af <Plug>(coc-funcobj-a)
151 omap if <Plug>(coc-funcobj-i)
152 omap af <Plug>(coc-funcobj-a)
153
154 " Use <TAB> for selections ranges.
155 " NOTE: Requires 'textDocument/selectionRange' support from the language server.
156 " coc-tsserver, coc-python are the examples of servers that support it.
157 " nmap <silent> <TAB> <Plug>(coc-range-select)
158 xmap <silent> <TAB> <Plug>(coc-range-select)
159
160 " Add `:Format` command to format current buffer.
161 command! -nargs=0 Format :call CocAction('format')
162
163 " Add `:Fold` command to fold current buffer.
164 command! -nargs=? Fold :call     CocAction('fold', <f-args>)
165
166 " Add `:OR` command for organize imports of the current buffer.
167 command! -nargs=0 OR   :call     CocAction('runCommand', 'editor.action.organizeImport')
168
169 " Mappings using CoCList:
170 " Symbol renaming.
171 nmap <leader>rn <Plug>(coc-rename)
172
173 " Formatting selected code.
174 xmap <leader>f  <Plug>(coc-format-selected)
175 nmap <leader>f  <Plug>(coc-format-selected)
176
177 nnoremap <leader>d  :CocFzfList diagnostics --current-buf<cr>
178 nnoremap <leader>c  :CocFzfList commands<cr>
179 nnoremap <leader>o  :CocFzfList outline<cr>
180 nnoremap <leader>s  :CocFzfList symbols<cr>
181
182
183
184 " nnoremap <leader>j  :<C-u>CocNext<CR>
185 " nnoremap <leader>k  :<C-u>CocPrev<CR>
186
187
188 autocmd BufWritePre *.go :call CocAction('organizeImport')
189
190 autocmd FileType go nmap <buffer> gta :call CocAction('runCommand', 'go.tags.add')<cr>
191 autocmd FileType go nmap <buffer> gtl :call CocAction('runCommand', 'go.tags.add.line')<cr>
192 autocmd FileType go nmap <buffer> gtr :call CocAction('runCommand', 'go.tags.remove')<cr>
193 autocmd FileType go nmap <buffer> gtj :call CocAction('runCommand', 'go.tags.add', 'json')<cr>
194 autocmd FileType go nmap <buffer> gty :call CocAction('runCommand', 'go.tags.add', 'yaml')<cr>
195 autocmd FileType go nmap <buffer> gtx :call CocAction('runCommand', 'go.tags.clear')<cr>
196