Vim dotfiles

This commit is contained in:
2018-08-23 16:41:22 +02:00
parent 8343fe1a9c
commit 63b994861c
7 changed files with 362 additions and 0 deletions

123
files/vim/config/base.vim Normal file
View File

@@ -0,0 +1,123 @@
" Lines number
set number
" Always show the statusline
set laststatus=2
" Necessary to show Unicode glyphs
set encoding=utf8
" tab length
set tabstop=4
" smart tab
set smartindent
" Tab to..?
set shiftround
" Display edition mode
set showmode
" Ignore case in search mode
set ignorecase
" Override the 'ignorecase' option if the search pattern
" contains upper case characters.
set smartcase
" Display uncomplete commands (??)
set showcmd
" Vim file name completion relative to current file
set autochdir
" While typing a search command, show immediately where the
" so far typed pattern matches.
set incsearch
" Use <C-L> to clear the highlighting of :set hlsearch.
set hlsearch
if maparg('<C-L>', 'n') ==# ''
nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>
endif
" Turn on the WiLd menu
set wildmenu
" Ignore compiled files
set wildignore=*.o,*~,*.pyc,*.swp
" Wrap lines
set wrap
" Turn backup off, since most stuff is in SVN, git et.c anyway...
set nobackup
set noswapfile
" Having relative number for lines
set relativenumber
" Display tab and ends of lines
" Shortcut to rapidly toggle `set list`
nmap <leader>L :set list!<CR>
" Behaviour of tab
set tabstop =4
set shiftwidth =4
set softtabstop =4
set expandtab
" Folding
set foldmethod=indent
" Use the same symbols as TextMate for tabstops and EOLs
" set listchars=tab:▸\ ,eol:¬
set listchars=nbsp,tab:··,trail,extends:▶,precedes:◀
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
"
" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
set mouse=a
endif
" Decorations
" ====================
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
endif
" When set to "dark", Vim will try to use colors that look
" good on a dark background. When set to "light", Vim will
" try to use colors that look good on a light background.
" Any other value is illegal.
set background=dark
" Color Scheme
colorscheme zenburn
set cursorline
" Align blocks of text and keep them selected
vmap < <gv
vmap > >gv
" Spelling
set spelllang=fr
" Set and unset spelling correction
map <silent> <F7> "<Esc>:silent setlocal spell! spelllang=en<CR>"
map <silent> <F6> "<Esc>:silent setlocal spell! spelllang=fr<CR>"
autocmd BufRead,BufNewFile *.{md,tex,rst} setlocal spell
execute "set colorcolumn=" . join(range(81,335), ',')
" Show what is written!
set conceallevel=0

View File

@@ -0,0 +1,72 @@
" Supertab
let g:SuperTabDefaultCompletionType = "context"
" Ultisnips
let g:ultisnips_python_style='sphinx'
let g:UltiSnipsEditSplit='vertical'
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
" let g:UltiSnipsExpandTrigger="tab"
let g:UltiSnipsExpandTrigger="<c-k>"
" Airline
let g:airline_powerline_fonts = 1
let g:tmuxline_powerline_separators = 0
" Nerdtree
let NERDTreeIgnore = ['.pyc$']
"autocmd VimEnter * NERDTree
" Vim-notes
let g:notes_directories = ['~/Documents/Notes']
let g:notes_suffix = '.md'
" Ale
let g:ale_sign_column_always = 1
let g:ale_sign_error = '⚑'
let g:ale_sign_warning = '⚐'
" fzf
" Search and switch buffers
nmap <leader>b :Buffers<cr>
" Find files by name under the current directory
nmap <leader>f :Files<cr>
" Find files by name under the home directory
nmap <leader>h :Files ~/<cr>
" Search content in the current file
" nmap <leader>l :BLines<cr>
" Search content in the current file and in files under the current directory
" nmap <leader>g :Ag<cr>
" IndentLine
let g:indentLine_fileTypeExclude = ['tex']
" let g:indentLine_concealcursor = ''
" let g:indentLine_conceallevel = 1
"
" Vim-polyglot
" let g:LatexBox_no_mappings = 1
let g:polyglot_disabled = ["latex"]
" Vimtex
let g:vimtex_compiler_latexmk = {
\ 'backend' : 'jobs',
\ 'background' : 1,
\ 'build_dir' : '',
\ 'callback' : 0,
\ 'continuous' : 1,
\ 'options' : [
\ '-pdf',
\ '-verbose',
\ '-file-line-error',
\ '-synctex=1',
\ '-interaction=nonstopmode',
\ '-silent',
\ '-shell-escape',
\ ],
\}
" Les fichiers sty et cls sont vus comme des fichiers tex
autocmd BufRead,BufNewFile *.{sty,cls} setlocal syntax=tex
autocmd FileType latex unmap <leader>ll
autocmd FileType latex nmap <leader>ll <plug>(vimtex-compile)