···11+# Set the iterm2_hostname ahead of time to make startup faster.
22+# See ./20-iterm2_shell_integration.fish
33+set -g iterm2_hostname $hostname
+22-48
.vimrc
···1515set matchpairs+=<:>
1616set wrapmargin=0
17171818-set iskeyword-=_
1919-2018set autoindent
2119filetype plugin indent on
2220···4745noremap gU <Nop>
4846noremap gUU <Nop>
49475050-" System copy-paste
4848+" System copy-paste on linux
5149map <C-C> "+ygv
52505351" Use newer info than the macOS builtin
···9593 " Disable airline by pretending it's already loaded
9694 let g:loaded_airline = 1
97959898- " TODO Make word wrap behave better with vscode
9999- " Try opening a JSON file with long lines for example
100100- set wrap
10196 set linebreak
10297 set textwidth=0
10398···124119 xmap <expr> i visualmode() ==# 'v' ? 'i' : 'mi'
125120 xmap <expr> I visualmode() ==# 'v' ? 'I' : 'mI'
126121127127- " Call VSCode commands using a visual selection from nvim
128128- function! s:vscodeNotifyVisualSelection(cmd) abort
129129- normal! gv
130130-131131- let vmode = visualmode()
132132- if vmode ==# "V"
133133- let startLine = line("v")
134134- let endLine = line(".")
135135- call VSCodeNotifyRange(a:cmd, startLine, endLine, 1)
136136- else
137137- let [startLine, startColumn] = getpos("v")[1:2]
138138- let [endLine, endColumn] = getpos(".")[1:2]
139139- call VSCodeNotifyRangePos(a:cmd, startLine, endLine, startColumn, endColumn, 1)
140140- endif
141141- endfunction
142142-143143- xnoremap <silent> <Leader>f :<C-u>call <SID>vscodeNotifyVisualSelection("actions.find")<CR>
144144- xnoremap <silent> <Leader>r :<C-u>call <SID>vscodeNotifyVisualSelection("editor.action.startFindReplaceAction")<CR>
145145-146146- " TODO: Make neovim use vscode builtin search
147147- " This is commented out because it doesn't really work well with cursor
148148- " movement, and using nvim's builtin search with / is better. It would be
149149- " nice to have though.
150150- " " probably can write a function that sets a variable forward or reverse search
151151- " " For now n and N will always go in the same direction
152152- " noremap <silent> ? :<C-u>call VSCodeNotify('actions.find')<CR>
153153- " noremap <silent> / :<C-u>call VSCodeNotify('actions.find')<CR>
122122+ xnoremap <Leader>f <Cmd>call VSCodeNotifyVisual("actions.find", 1)<CR>
123123+ xnoremap <Leader>r <Cmd>call VSCodeNotifyVisual("editor.action.startFindReplaceAction", 1)<CR>
154124155155- " " Sending `i<Esc>l` is a hack to force neovim to use the VSCode
156156- " " cursor location after perfoming the next/prev command, since a mode change
157157- " " results in a cursor update
158158- " noremap <silent> N :<C-u>
159159- " \call VSCodeCall('editor.action.previousMatchFindAction')<CR>
160160- " \call VSCodeCall('cursorMove', {'to': 'right', 'by': 'character'})<CR>
161161- " noremap <silent> n :<C-u>
162162- " \call VSCodeCall('editor.action.nextMatchFindAction')<CR>
163163- " \call VSCodeCall('cursorMove', {'to': 'right', 'by': 'character'})<CR>
125125+ " blocking, so we can run it as part of a `runCommands` series in vscode
126126+ noremap <Leader>m <Cmd>call VSCodeCall("workbench.action.addComment")<CR>
164127165128else
166129 " Ordinary vim/neovim settings that don't apply in VSCode
···230193231194" Firenvim settings
232195if exists('g:started_by_firenvim')
196196+ " For whatever reason this doesn't needs explicit keybinding:
197197+ " https://github.com/glacambre/firenvim/issues/332
198198+ inoremap <D-v> <Esc>"+pa
199199+233200 let fc = g:firenvim_config['localSettings']
234201 let fc['.*'] = {
235202 \ 'selector': 'textarea:not([readonly], [aria-readonly="true"])',
236203 \ 'cmdline': 'neovim',
237204 \ }
238205239239- " On GitHub, there aren't really any text boxes worth taking over tbh
240240- let fc['https?://github[.]com'] = { 'takeover': 'never', 'priority': 1, }
241241- " Disable for google search editor
242242- let fc['https?://(www[.])?google[.]com'] = { 'takeover': 'never', 'priority': 1 }
243243- " Disable entirely for Jira/Confluence
244244- let fc['https?://[^.]+[.]atlassian[.]net'] = { 'takeover': 'never', 'priority': 1 }
206206+ let disabled_urls = [
207207+ \ 'https?://github[.]com',
208208+ \ 'https?://demangler[.]com',
209209+ \ 'https?://(www[.])?google[.]com',
210210+ \ 'https?://[^.]+[.]atlassian[.]net',
211211+ \ 'https?://play[.]rust-lang[.]org',
212212+ \ 'https?://app[.]circleci[.]com',
213213+ \ ]
214214+ for disabled_url in disabled_urls
215215+ let fc[disabled_url] = { 'takeover': 'never', 'priority': 1 }
216216+ endfor
245217246218 set mouse=
247219248220 autocmd BufEnter github.com_*.txt set filetype=markdown
249221 autocmd BufEnter www.shadertoy.com_*.txt set filetype=glsl
222222+ autocmd BufEnter pkg.go.dev_*.txt set filetype=go
223223+ autocmd BufEnter go.dev_*.txt set filetype=go
250224251225 " TODO: maybe set this after a delay for UIEnter, like in
252226 " https://github.com/glacambre/firenvim/issues/972#issuecomment-1048209573