208 lines
5.5 KiB
VimL
208 lines
5.5 KiB
VimL
autocmd FileType asm noremap <F12> <ESC>:execute 'silent !qtspim' expand('%::p')<CR>
|
|
|
|
nnoremap <C-p> :Buffers<CR>
|
|
nnoremap <C-g> :Ag<CR>
|
|
|
|
"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>
|
|
|
|
nnoremap <leader><CR> :vert term<CR>
|
|
|
|
let g:netrw_keepdir=0
|
|
let g:netrw_banner=0
|
|
let g:netrw_liststyle=3
|
|
let python_highlight_all=1
|
|
let g:pymode_python = 'python3'
|
|
let g:pymode_options_max_line_length = 120
|
|
let g:htmljinja_disable_detection = 1
|
|
|
|
let g:vimtex_view_method = 'zathura'
|
|
let g:vimtex_grammar_vlty = {'lt_command': 'languagetool'}
|
|
let g:vimtex_grammar_textidote = {'jar': '/usr/share/java/textidote.jar'}
|
|
|
|
let g:vimtex_view_method = 'zathura'
|
|
|
|
nnoremap gd :YcmCompleter GoToDefinition<CR>
|
|
nnoremap gr :YcmCompleter GoToReferences<CR>
|
|
nnoremap K :YcmCompleter GetDoc<CR>
|
|
nnoremap <CR> :YcmCompleter FixIt<CR>
|
|
noremap gN :Lex<CR>
|
|
|
|
nnoremap yp :let @+=expand('%') .. '#' .. line('.')<CR>
|
|
|
|
nnoremap <F12> :Make<CR>
|
|
nnoremap <leader><F12> :Make run<CR>
|
|
|
|
"Documentation
|
|
nnoremap K :execute 'vert term' &keywordprg '<cexpr>'<cr>
|
|
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'"
|
|
let g:ycm_global_ycm_extra_conf = '~/.vim/ycm_extra_conf.py'
|
|
" let g:ycm_java_binary_path = "/usr/lib/jvm/java-17-openjdk/bin/java"
|
|
let g:ycm_language_server = [
|
|
\ {
|
|
\ 'name': 'tex',
|
|
\ 'cmdline': ['texlab'],
|
|
\ 'filetypes': ['tex'],
|
|
\ },
|
|
\ ]
|
|
|
|
" let g:completor_clang_binary = "/usr/bin/clang"
|
|
"fold with space
|
|
nnoremap <space> za
|
|
syntax on
|
|
|
|
" set foldcolumn=1
|
|
set autochdir
|
|
set clipboard^=unnamed,unnamedplus
|
|
set concealcursor=
|
|
set conceallevel=2
|
|
set encoding=utf-8
|
|
set foldlevel=99
|
|
set foldmethod=syntax
|
|
set hidden
|
|
set hls
|
|
set ignorecase
|
|
set incsearch
|
|
set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<,space:·
|
|
set mouse=a
|
|
set nocompatible
|
|
set nowrap
|
|
set nu
|
|
set rnu
|
|
set scrolloff=10
|
|
set shiftwidth=4
|
|
set showcmd
|
|
set spelllang+=fr
|
|
set splitbelow splitright
|
|
set tabstop=4
|
|
set ttymouse=xterm2
|
|
|
|
color desert
|
|
hi Normal ctermfg=None ctermbg=None
|
|
hi NonText ctermfg=None ctermbg=None
|
|
|
|
packadd termdebug
|
|
let g:termdebug_wide=1
|
|
|
|
filetype off
|
|
set rtp+=$HOME/.vim/bundle/Vundle.vim/
|
|
call vundle#begin()
|
|
|
|
"Mandatory
|
|
Plugin 'vundleVim/Vundle.vim' "plugin Manager
|
|
|
|
"Quality of life (any)
|
|
Plugin 'itchyny/lightline.vim' "status bar
|
|
Plugin 'kien/rainbow_parentheses.vim' "Better Raimbow Parentheses
|
|
Plugin 'mhinz/vim-startify' "start screen
|
|
Plugin 'lilydjwg/colorizer' "color hexcode
|
|
Plugin 'jiangmiao/auto-pairs' "auto Pair Brackets
|
|
" Plugin 'Yggdroot/indentLine' "show indent - bugging conceal
|
|
Plugin 'szw/vim-maximizer'
|
|
" Plugin 'preservim/nerdtree' "Directory Visulaliser :Nerdtree
|
|
Plugin 'junegunn/fzf', {'do': { -> fzf#install() }}
|
|
Plugin 'junegunn/fzf.vim'
|
|
Plugin 'junegunn/vim-peekaboo' "see content of register before past for @ C-R and \"
|
|
Plugin 'chrisbra/unicode.vim'
|
|
|
|
"useful in multiple languages
|
|
Plugin 'SirVer/ultisnips' "fast write
|
|
Plugin 'honza/vim-snippets' "lib of snips
|
|
Plugin 'majutsushi/tagbar' "display tagBar with :TagbarToggle
|
|
" Plugin 'maralla/completor.vim' "completion menu
|
|
" Plugin 'tokorom/completor-shell' "Add on of completor.vim for shell scripting
|
|
Plugin 'tpope/vim-commentary' "comment with <gcc>
|
|
" Plugin 'dense-analysis/ale' "Async error checker (test usefulness)
|
|
Plugin 'puremourning/vimspector' "Debugger
|
|
|
|
Plugin 'ycm-core/YouCompleteMe' "completion tool
|
|
|
|
"git
|
|
Plugin 'mhinz/vim-signify' "git diff show
|
|
Plugin 'tpope/vim-fugitive' "for the :Git <command>
|
|
|
|
"php
|
|
" Plugin 'StanAngeloff/php.vim' "php syntax
|
|
" Plugin 'phpactor/phpactor' "php auto-completion
|
|
|
|
"python
|
|
" Plugin 'python-mode/python-mode' "A python IDE
|
|
Plugin 'mitsuhiko/vim-jinja'
|
|
|
|
"html/css
|
|
Plugin 'mattn/emmet-vim' "Fast http
|
|
Plugin 'vim-scripts/loremipsum' "ipsum generator :Loremipsum <word>
|
|
Plugin 'tpope/vim-surround' "Surround html tags
|
|
Plugin 'sukima/xmledit' "Edit XML and HTML
|
|
|
|
"lua
|
|
" Plugin 'wsdjeg/vim-lua' "lua syntax
|
|
|
|
"markdown
|
|
Plugin 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vundle'] }
|
|
|
|
"c & cpp
|
|
Plugin 'bfrg/vim-cpp-modern' "Extended vim syntax highlight c++
|
|
Plugin 'a.vim' "go from hpp to cpp with :A
|
|
" Plugin 'xavierd/clang_complete' "CLang Complete (don't work with ycm)
|
|
Plugin 'cdelledonne/vim-cmake'
|
|
|
|
"glsl (shader)
|
|
Plugin 'tikhomirov/vim-glsl'
|
|
|
|
"c sharp
|
|
" Plugin 'OmniSharp/omnisharp-vim'
|
|
|
|
"latex
|
|
|
|
Plugin 'lervag/vimtex'
|
|
Plugin 'gillescastel/latex-snippets'
|
|
|
|
"uml
|
|
Plugin 'weirongxu/plantuml-previewer.vim'
|
|
Plugin 'tyru/open-browser.vim'
|
|
Plugin 'aklt/plantuml-syntax'
|
|
|
|
call vundle#end()
|
|
|
|
filetype plugin indent on
|
|
set omnifunc=syntaxcomplete#Complete
|