2024-05-08 12:30:33 +02:00
|
|
|
nnoremap <C-p> :Buffers<CR>
|
2023-10-24 23:28:14 +02:00
|
|
|
nnoremap <C-g> :Ag<CR>
|
2024-08-23 11:20:30 +02:00
|
|
|
map gf :e <cfile><CR>
|
|
|
|
|
|
|
|
"FZF Buffer Delete
|
|
|
|
|
|
|
|
function! s:list_buffers()
|
|
|
|
redir => list
|
|
|
|
silent ls
|
|
|
|
redir END
|
|
|
|
return split(list, "\n")
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! s:delete_buffers(lines)
|
|
|
|
execute 'bwipeout' join(map(a:lines, {_, line -> split(line)[0]}))
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
|
|
command! BD call fzf#run(fzf#wrap({
|
|
|
|
\ 'source': s:list_buffers(),
|
|
|
|
\ 'sink*': { lines -> s:delete_buffers(lines) },
|
|
|
|
\ 'options': '--multi --reverse --bind ctrl-a:select-all+accept'
|
|
|
|
\ }))
|
2023-10-24 23:28:14 +02:00
|
|
|
|
2024-05-08 12:30:33 +02:00
|
|
|
"alt g to :Gfiles (if in git folder) else :Files
|
|
|
|
function! GFilesFallback()
|
|
|
|
let output = system('git rev-parse --show-toplevel') " Is there a faster way?
|
|
|
|
let prefix = get(g:, 'fzf_command_prefix', '')
|
|
|
|
if v:shell_error == 0
|
|
|
|
exec "normal :" . prefix . "GFiles\<CR>"
|
|
|
|
else
|
|
|
|
exec "normal :" . prefix . "Files\<CR>"
|
|
|
|
endif
|
|
|
|
return 0
|
|
|
|
endfunction
|
|
|
|
execute "set <M-g>=\eg"
|
|
|
|
nnoremap <M-g> :call GFilesFallback()<CR>
|
|
|
|
|
2023-10-24 23:28:14 +02:00
|
|
|
nnoremap <leader><CR> :vert term<CR>
|
|
|
|
|
2024-01-06 18:02:00 +01:00
|
|
|
let g:netrw_keepdir=0
|
|
|
|
let g:netrw_banner=0
|
|
|
|
let g:netrw_liststyle=3
|
2023-10-24 23:28:14 +02:00
|
|
|
let python_highlight_all=1
|
|
|
|
let g:pymode_python = 'python3'
|
|
|
|
let g:pymode_options_max_line_length = 120
|
|
|
|
let g:htmljinja_disable_detection = 1
|
2024-01-03 11:04:20 +01:00
|
|
|
|
|
|
|
let g:vimtex_view_method = 'zathura'
|
2023-10-24 23:28:14 +02:00
|
|
|
let g:vimtex_grammar_vlty = {'lt_command': 'languagetool'}
|
|
|
|
let g:vimtex_grammar_textidote = {'jar': '/usr/share/java/textidote.jar'}
|
|
|
|
|
2024-01-06 18:02:00 +01:00
|
|
|
let g:vimtex_view_method = 'zathura'
|
2023-10-24 23:28:14 +02:00
|
|
|
|
2024-08-23 11:20:30 +02:00
|
|
|
" nnoremap gd :YcmCompleter GoToDefinition<CR>
|
|
|
|
" nnoremap gr :YcmCompleter GoToReferences<CR>
|
|
|
|
" nnoremap K :YcmCompleter GetDoc<CR>
|
|
|
|
" nnoremap \<CR> :YcmCompleter FixIt<CR>
|
2023-11-02 09:57:45 +01:00
|
|
|
noremap gN :Lex<CR>
|
2023-11-02 14:24:23 +01:00
|
|
|
|
2023-10-24 23:28:14 +02:00
|
|
|
nnoremap <F12> :Make<CR>
|
|
|
|
nnoremap <leader><F12> :Make run<CR>
|
|
|
|
|
|
|
|
"Documentation
|
2024-08-23 11:20:30 +02:00
|
|
|
" nnoremap K :execute 'vert term' &keywordprg '<cexpr>'<cr>
|
2023-10-24 23:28:14 +02:00
|
|
|
command Curl :execute 'vert term lynx -dump' escape(@+, '#')
|
|
|
|
command OpenLink :silent w !urlscan
|
|
|
|
|
|
|
|
" AgIn: Start ag in the specified directory
|
|
|
|
"
|
|
|
|
" e.g.
|
|
|
|
" :AgIn .. foo
|
|
|
|
function! s:ag_in(bang, ...)
|
|
|
|
let start_dir=expand(a:1)
|
|
|
|
|
|
|
|
if !isdirectory(start_dir)
|
|
|
|
throw 'not a valid directory: ' .. start_dir
|
|
|
|
endif
|
|
|
|
" Press `?' to enable preview window.
|
|
|
|
call fzf#vim#ag(join(a:000[1:], ' '), fzf#vim#with_preview({'dir': start_dir}, 'up:50%:hidden', '?'), a:bang)
|
|
|
|
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
command! -bang -nargs=+ -complete=dir AgIn call s:ag_in(<bang>0, <f-args>)
|
|
|
|
|
|
|
|
let g:UltiSnipsExpandTrigger="<c-l>"
|
|
|
|
let g:UltiSnipsListSnipets="<c-h>"
|
|
|
|
let g:UltiSnipsEditSplit="vertical"
|
|
|
|
|
|
|
|
let g:cpp_attributes_highlight = 1
|
|
|
|
|
|
|
|
let g:ycm_always_populate_location_list = 1
|
|
|
|
let g:ycm_goto_buffer_command = "'split-or-existing-window'"
|
2024-04-16 12:29:05 +02:00
|
|
|
let g:ycm_global_ycm_extra_conf = '~/.vim/ycm_extra_conf.py'
|
2024-05-08 12:30:33 +02:00
|
|
|
" let g:ycm_java_binary_path = "/usr/lib/jvm/java-17-openjdk/bin/java"
|
2023-11-02 11:52:44 +01:00
|
|
|
let g:ycm_language_server = [
|
2024-06-15 13:19:11 +02:00
|
|
|
\ {
|
2023-11-02 11:52:44 +01:00
|
|
|
\ 'name': 'tex',
|
|
|
|
\ 'cmdline': ['texlab'],
|
2024-01-06 18:02:00 +01:00
|
|
|
\ 'filetypes': ['tex'],
|
|
|
|
\ },
|
2024-06-15 13:19:11 +02:00
|
|
|
\ {
|
2024-08-23 11:20:30 +02:00
|
|
|
\ 'name': 'vue',
|
|
|
|
\ 'cmdline': [ 'vue-language-server', '--stdio' ],
|
|
|
|
\ 'filetypes': ['vue'],
|
|
|
|
\ },
|
|
|
|
\ {
|
2024-06-15 13:19:11 +02:00
|
|
|
\ 'name': 'godot',
|
|
|
|
\ 'filetypes': ['gdscript'],
|
|
|
|
\ 'port': 6008,
|
|
|
|
\ 'project_root_files': ['project.godot']
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'name': 'arduino',
|
|
|
|
\ 'filetypes': ['arduino'],
|
|
|
|
\ 'cmdline': ['arduino-language-server',
|
|
|
|
\ '-clangd', '/usr/bin/clangd',
|
|
|
|
\ '-cli', '/usr/bin/arduino-cli',
|
|
|
|
\ '-cli-config', '$HOME/.arduino15/arduino-cli.yaml',
|
|
|
|
\ '-fqbn', 'arduino:avr:uno'],
|
|
|
|
\ },
|
2023-11-02 11:52:44 +01:00
|
|
|
\ ]
|
2023-10-24 23:28:14 +02:00
|
|
|
|
|
|
|
" let g:completor_clang_binary = "/usr/bin/clang"
|
|
|
|
"fold with space
|
|
|
|
nnoremap <space> za
|
|
|
|
syntax on
|
|
|
|
|
2024-05-08 12:30:33 +02:00
|
|
|
" set foldcolumn=1
|
2023-10-24 23:28:14 +02:00
|
|
|
set autochdir
|
|
|
|
set clipboard^=unnamed,unnamedplus
|
|
|
|
set concealcursor=
|
|
|
|
set conceallevel=2
|
2024-01-03 11:04:20 +01:00
|
|
|
set encoding=utf-8
|
|
|
|
set foldlevel=99
|
|
|
|
set foldmethod=syntax
|
2024-05-08 12:30:33 +02:00
|
|
|
set hidden
|
2024-01-03 11:04:20 +01:00
|
|
|
set hls
|
|
|
|
set ignorecase
|
|
|
|
set incsearch
|
|
|
|
set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<,space:·
|
2023-10-24 23:28:14 +02:00
|
|
|
set mouse=a
|
2024-01-03 11:04:20 +01:00
|
|
|
set nocompatible
|
|
|
|
set nowrap
|
|
|
|
set nu
|
|
|
|
set rnu
|
2024-01-10 14:46:47 +01:00
|
|
|
set scrolloff=10
|
2024-05-08 12:30:33 +02:00
|
|
|
set shiftwidth=4
|
2024-08-23 11:20:30 +02:00
|
|
|
set shortmess=atToOs
|
2024-01-03 11:04:20 +01:00
|
|
|
set showcmd
|
|
|
|
set spelllang+=fr
|
|
|
|
set splitbelow splitright
|
|
|
|
set tabstop=4
|
2024-08-23 11:20:30 +02:00
|
|
|
|
|
|
|
if !has('nvim')
|
|
|
|
set ttymouse=xterm2
|
|
|
|
endif
|
2023-10-24 23:28:14 +02:00
|
|
|
|
|
|
|
color desert
|
|
|
|
hi Normal ctermfg=None ctermbg=None
|
|
|
|
hi NonText ctermfg=None ctermbg=None
|
|
|
|
|
2024-08-23 11:20:30 +02:00
|
|
|
" packadd termdebug
|
|
|
|
let g:termdebug_wide=1
|
|
|
|
filetype plugin indent on
|