Updates

fd5011f3d9c8effb7c056a7b9d623f60831fdef7
Alexis Sellier committed ago 1 parent 50498a87
.config/nvim/coc-settings.json +2 -0
21 21
  "coc.preferences.enableMessageDialog": true,
22 22
  "coc.preferences.formatOnSaveFiletypes": [
23 23
    "rust"
24 24
  ],
25 25
  "coc.source.snippets.enable": false,
26 +
  "coc.source.buffer.enable": false,
27 +
  "coc.source.file.enable": false,
26 28
27 29
  "rust-analyzer.inlayHints.typeHintsSeparator": "",
28 30
  "rust-analyzer.inlayHints.chainingHintsSeparator": " ",
29 31
  "rust-analyzer.updates.prompt": false,
30 32
  "rust-analyzer.diagnostics.enableExperimental": true,
.profile +1 -1
2 2
3 3
if command -v keychain >/dev/null; then
4 4
  eval $(keychain --eval --agents ssh -Q --quiet ~/.ssh/id_rsa)
5 5
fi
6 6
7 -
export PATH=~/bin:~/.local/bin:~/.yarn/bin:~/.cabal/bin:~/.cargo/bin:~/.gem/ruby/2.6.0/bin:~/.radicle/bin:~/.npm-packages/bin:$PATH
7 +
export PATH=~/bin:~/.local/bin:~/.yarn/bin:~/.gcloud/bin:~/.cabal/bin:~/.cargo/bin:~/.gem/ruby/2.6.0/bin:~/.radicle/bin:~/.npm-packages/bin:$PATH
8 8
export EDITOR=nvim
9 9
export VISUAL=nvim
10 10
export MOZ_USE_XINPUT2=1 # Pixel scrolling in Firefox
11 11
export RIPGREP_CONFIG_PATH=$HOME/.rgrc
12 12
export PATH="$HOME/.radicle/bin:$PATH"
.vimrc +13 -2
95 95
let g:vim_markdown_no_default_key_mappings = 1
96 96
97 97
" Latex
98 98
let g:vimtex_quickfix_mode = 0
99 99
100 +
" Svelte
101 +
let g:svelte_preprocessors = ['typescript', 'ts']
102 +
let g:svelte_preprocessor_tags = [
103 +
  \ { 'name': 'ts', 'tag': 'script', 'as': 'typescript' }
104 +
  \ ]
105 +
100 106
" inccommand
101 107
if has("nvim")
102 108
  set inccommand=nosplit
103 109
endif
104 110
111 117
endfunction
112 118
113 119
" Per file-type indentation
114 120
au FileType haskell     setlocal number sts=4 sw=4 expandtab formatprg=stylish-haskell
115 121
au FileType javascript  setlocal number sts=2 sw=2 expandtab nowrap
122 +
au FileType typescript  setlocal number sts=2 sw=2 expandtab nowrap
116 123
au FileType svelte      setlocal number sts=2 sw=2 expandtab nowrap
117 124
au FileType css         setlocal number ts=2  sw=2 noexpandtab nowrap
118 125
au FileType go          setlocal number ts=4  sw=4 noexpandtab
119 126
au FileType c,cpp,glsl  setlocal number ts=8  sw=8 noexpandtab
120 127
au FileType lua         setlocal number       sw=2 expandtab
335 342
  Plug 'hail2u/vim-css3-syntax'
336 343
  Plug 'lervag/vimtex', { 'for': ['tex'] }
337 344
  Plug 'itchyny/vim-gitbranch'
338 345
  Plug 'cespare/vim-toml'
339 346
  Plug 'rust-lang/rust.vim'
340 -
  Plug 'neoclide/coc.nvim', { 'branch': 'release', 'for': ['rust'] }
347 +
  Plug 'neoclide/coc.nvim', { 'branch': 'release', 'for': ['rust', 'typescript', 'svelte'] }
341 348
  Plug 'tomlion/vim-solidity'
342 349
  " For v0.4
343 350
  Plug 'airblade/vim-gitgutter'
344 351
  " For v0.5
345 352
  " Plug 'nvim-lua/plenary.nvim'
346 353
  " Plug 'lewis6991/gitsigns.nvim'
347 -
  Plug 'leafgarland/typescript-vim'
354 +
  Plug 'leafgarland/typescript-vim', { 'for': ['typescript'] }
348 355
349 356
  call plug#end()
350 357
endif
351 358
352 359
"
399 406
  nmap <silent> gi           <Plug>(coc-implementation)
400 407
  nmap <silent> gr           <Plug>(coc-references)
401 408
  nmap <silent> gj           <Plug>(coc-diagnostic-next)
402 409
  nmap <silent> gk           <Plug>(coc-diagnostic-prev)
403 410
  nmap <silent> <leader>/    :CocList --interactive symbols<CR>
411 +
  nmap <silent> <leader>r    <Plug>(coc-rename)
404 412
405 413
  " This is a kind of hack to make <C-Y> not trigger snippet expansion.
406 414
  " We use <C-p><C-n> to insert the selection without triggering anything, and
407 415
  " then close the popup.
408 416
  inoremap <silent><expr> <C-Y> pumvisible() ? "<C-p><C-n><Esc>a" : "\<C-Y>"
417 +
  " Trigger completion on <CR>.
418 +
  inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
409 419
endfunction
410 420
autocmd User CocNvimInit call SetupCoc()
411 421
422 +
412 423
" Use custom colors.
413 424
" This has to go after plugin initialization.
414 425
try
415 426
  colorscheme shady
416 427
catch
bin/toggle-displays +5 -5
3 3
output = `xrandr`
4 4
5 5
internal = /^(eDP-?1)/.match(output)[1]
6 6
external = /^(DP-?1)/.match(output)[1]
7 7
8 -
internal_connected = /^#{internal} connected/m.match?(output)
9 -
external_connected = /^#{external} connected/m.match?(output)
8 +
internal_connected = /^#{internal} connected/.match?(output)
9 +
external_connected = /^#{external} connected/.match?(output)
10 10
11 -
internal_active = /^#{internal} connected .*?\d+x\d+\b/m.match?(output)
12 -
external_active = /^#{external} connected .*?\d+x\d+\b/m.match?(output)
11 +
internal_active = /^#{internal} connected .*?\d+x\d+\b/.match?(output)
12 +
external_active = /^#{external} connected .*?\d+x\d+\b/.match?(output)
13 13
14 14
puts "#{internal} connected: #{internal_connected}"
15 15
puts "#{external} connected: #{external_connected}"
16 16
puts "#{internal} active: #{internal_active}"
17 17
puts "#{external} active: #{external_active}"
20 20
  system "xrandr #{args}"
21 21
end
22 22
23 23
if external_active && !internal_active && internal_connected then
24 24
  # Switch External -> Internal
25 -
  xrandr "--output #{internal} --auto --primary --output #{external} --off "
25 +
  xrandr "--output #{internal} --auto --primary --output #{external} --off"
26 26
elsif internal_active && !external_active && external_connected then
27 27
  # Switch Internal -> External
28 28
  xrandr "--output #{external} --auto --primary --output #{internal} --off"
29 29
elsif !internal_active && !external_active && external_connected && internal_connected  then
30 30
  # Switch None -> All