home/dotfiles/.vimrc

162 lines
4.1 KiB
VimL
Raw Normal View History

2020-06-19 08:03:11 +02:00
" VIM Configuration - DarKou
2020-04-24 19:21:58 +02:00
2020-06-19 08:03:11 +02:00
" Cancel VI compatibility
set nocompatible
2020-04-24 19:21:58 +02:00
2020-06-19 08:03:11 +02:00
" -- Vim-plug
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
2022-12-02 15:16:27 +01:00
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
2020-06-19 08:03:11 +02:00
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
2022-12-02 15:16:27 +01:00
Plug 'arcticicestudio/nord-vim'
Plug 'sjbach/lusty'
Plug 'kshenoy/vim-signature'
Plug 'w0rp/ale'
Plug 'ap/vim-css-color'
Plug 'mileszs/ack.vim'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'moll/vim-node'
Plug 'pangloss/vim-javascript'
Plug 'briancollins/vim-jst'
Plug '1995eaton/vim-better-javascript-completion'
Plug 'heavenshell/vim-jsdoc', {
\ 'for': ['javascript', 'javascript.jsx','typescript'],
\ 'do': 'make install'
\}
Plug 'JamshedVesuna/vim-markdown-preview'
Plug 'ternjs/tern_for_vim', {'do': 'yarn install'}
Plug 'alvan/vim-closetag'
Plug 'psykidellic/vim-jekyll'
Plug 'airblade/vim-gitgutter'
Plug 'yuezk/vim-js'
Plug 'maxmellon/vim-jsx-pretty'
Plug 'briancollins/vim-jst'
Plug 'dpelle/vim-grammalecte'
2020-06-19 08:03:11 +02:00
" Initialize plugin system
call plug#end()
2020-07-11 08:27:10 +02:00
" -- Markdown preview
let vim_markdown_preview_browser='Mozilla Firefox'
2020-06-19 08:03:11 +02:00
" -- Display
colorscheme nord
set title
set number
set ruler
set wrap
set scrolloff=5
syntax enable
2020-07-11 08:27:10 +02:00
set encoding=utf-8
set fileencoding=utf-8
set showmatch " When a bracket is inserted, briefly jump to the matching one
set cursorline " Highlight the screen line of the cursor
2020-06-19 08:03:11 +02:00
filetype on
filetype plugin on
filetype indent on
2020-07-22 15:19:00 +02:00
set omnifunc=syntaxcomplete#Complete
2020-06-19 08:03:11 +02:00
:highlight ExtraWhitespace ctermbg=red guibg=red
:match ExtraWhitespace /\s\+$/
:match errorMsg /\s\+$/
2020-06-19 08:03:11 +02:00
" -- Search
set ignorecase
set smartcase
set incsearch
set hlsearch
" -- Ack search
let g:ackprg="ack -H --nocolor --nogroup --column"
nmap <leader>j mA:Ack<space>
nmap <leader>ja mA:Ack "<C-r>=expand("<cword>")<cr>"
nmap <leader>jA mA:Ack "<C-r>=expand("<cWORD>")<cr>"
" -- Ctrlp
let g:ctrlp_map='<leader>c'
" -- Beep
set visualbell
set noerrorbells
"
set backspace=indent,eol,start
" Hide file when open other file
set hidden
" Code formating
2020-07-11 08:27:10 +02:00
set smartindent " Do smart autoindenting when starting a new line
set tabstop=2 " Number of spaces that a <Tab> in the file counts for
set shiftwidth=2 " Alignment with '<' and '>'
set expandtab " Use spaces instead of tab
2020-06-19 08:03:11 +02:00
2020-07-05 10:47:31 +02:00
augroup myTodo
autocmd!
autocmd Syntax * syntax match myTodo /\v\_.<(TODO|FIXME|INFO).*/hs=s+1 containedin=.*Comment
augroup END
highlight link myTodo Todo
2020-07-11 08:27:10 +02:00
2020-07-22 15:19:00 +02:00
" Auto close brackets/…
inoremap " ""<left>
inoremap ' ''<left>
inoremap ` ``<left>
inoremap ( ()<left>
inoremap [ []<left>
inoremap { {}<left>
inoremap {<CR> {<CR>}<ESC>O
inoremap {;<CR> {<CR>};<ESC>O
" -- Remove unwantedd spaces
2020-08-17 11:52:31 +02:00
function GlobalTrimWhiteSpace()
2020-07-22 15:19:00 +02:00
%s/\s*$//
''
endfunction
set list listchars=trail:.,extends:>
2020-08-17 11:52:31 +02:00
autocmd FileWritePre * call GlobalTrimWhiteSpace()
autocmd FileAppendPre * call GlobalTrimWhiteSpace()
autocmd FilterWritePre * call GlobalTrimWhiteSpace()
autocmd BufWritePre * call GlobalTrimWhiteSpace()
2020-07-22 15:19:00 +02:00
2020-08-17 11:52:31 +02:00
map <F2> :call GlobalTrimWhiteSpace()<CR>
map! <F2> :call GlobalTrimWhiteSpace()<CR>
2020-07-22 15:19:00 +02:00
2020-07-11 08:27:10 +02:00
" -- Plugins configurations
I3 to Sway (#1) Added some ignored folders and files Updated waybar clock for Debian 11 Fixed bug on screen definition Fixed Iiyama North America PL2483H 1173700204528 Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Some changes for work environment Some changes for work environment Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Added .mp3 files Updated waybar config for laptop Added vim-jsx Added Teams to startup section (sad day in life!) Updated mpd config (local source) Added script for syncing my music Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated ranger config Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Replaced termite with alacritty Replaced termite by alacritty Updated rsync.sh results Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated github user Updated irc alias Minor changes Added master if fail fait dev* Added zsh prompt Updated output definitions Added KDEConnect at startup Added second screen Merge branch 'gentoo-sway' of git.darkou.fr:dbroqua/home into gentoo-sway Updated README Added C.A.V.A. Fixed bug for vte Added Tofu HHKB keyboard config Added script to update system Updated FuzzFm entry Added menu entry for Carnet Added qcad's ebuild Updated waybar for Thinkpad Updated temperature list for Thinkpad Fixed bug Updated input for thinkpad Added script to order files for Alpine car audio system Updated Fuzz url Added Grammalecte plugin Added displays for ThinkStation and ThinkPad Merge branch 'gentoo-sway' of framagit.org:dbroqua/home into gentoo-sway Updated waybar for laptop Fixed bug on adjust brightness Moved applications Co-authored-by: dbroqua <contact@darkou.fr> Co-authored-by: dbroqua <dbroqua@mousur.org> Reviewed-on: https://git.darkou.fr/dbroqua/home/pulls/1 Co-Authored-By: Damien Broqua <dbroqua@noreply.localhost> Co-Committed-By: Damien Broqua <dbroqua@noreply.localhost>
2021-10-21 21:40:47 +02:00
" Grammalecte
:let g:grammalecte_cli_py='$HOME/.Grammalecte/grammalecte-cli.py'
2020-08-17 11:52:31 +02:00
" ale
let b:ale_linters = ['eslint']
let g:ale_fixers = {
2022-12-02 15:16:27 +01:00
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'javascript': ['prettier', 'eslint'],
\ 'css': ['prettier']
\ }
2020-08-17 11:52:31 +02:00
let g:ale_sign_error = '❌'
let g:ale_sign_warning = '⚠️'
let g:ale_fix_on_save = 1
2020-07-11 08:27:10 +02:00
" vim-javascript
let g:javascript_plugin_jsdoc = 1 " Enables syntax highlighting for JSDocs
let g:javascript_plugin_flow = 1 " Enables syntax highlighting for Flow
2020-08-30 21:46:08 +02:00
" vim-closetag
let g:closetag_filenames = '*.html,*.xhtml,*.phtml'
let g:closetag_xhtml_filenames = '*.xhtml,*.jsx, *.ejs'
let g:closetag_filetypes = 'html,xhtml,phtml'
let g:closetag_xhtml_filetypes = 'xhtml,jsx'
let g:closetag_emptyTags_caseSensitive = 1
let g:closetag_regions = {
2022-12-02 15:16:27 +01:00
\ 'typescript.tsx': 'jsxRegion,tsxRegion',
\ 'javascript.jsx': 'jsxRegion',
\ }
2020-08-30 21:46:08 +02:00
let g:closetag_shortcut = '>'
let g:closetag_close_shortcut = '<leader>>'