You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
149 lines
3.2 KiB
VimL
149 lines
3.2 KiB
VimL
" ---------------------------
|
|
" -- Vundle requirements --
|
|
" ---------------------------
|
|
|
|
set nocompatible
|
|
set encoding=utf-8
|
|
filetype off
|
|
|
|
" Avoid delay between commands
|
|
set timeoutlen=1000 ttimeoutlen=0
|
|
|
|
set shell=/bin/sh
|
|
|
|
set rtp+=~/.vim/bundle/Vundle.vim
|
|
|
|
call vundle#begin()
|
|
Plugin 'VundleVim/Vundle.vim'
|
|
Plugin 'christoomey/vim-tmux-navigator'
|
|
Plugin 'dpelle/vim-Grammalecte'
|
|
"Plugin 'racer-rust/vim-racer'
|
|
"Plugin 'mustache/vim-mustache-handlebars'
|
|
Bundle 'Glench/Vim-Jinja2-Syntax'
|
|
call vundle#end()
|
|
|
|
" --------------------------
|
|
" -- Personal options --
|
|
" --------------------------
|
|
|
|
" Sets syntax highlighting on .hbs files as html
|
|
" autocmd BufNewFile,BufRead *.hbs set filetype=html
|
|
|
|
" Enable line number display
|
|
set number
|
|
|
|
" Enable swap directory in a local folder (avoids ghost copies)
|
|
set directory=$HOME/.vim/swap//
|
|
|
|
" Use plugins depending on the filetype
|
|
filetype plugin indent on
|
|
|
|
" Enable syntax highlighting
|
|
syntax on
|
|
|
|
" Indent depending on the previous line
|
|
set autoindent
|
|
|
|
set smartindent
|
|
|
|
" Replace tabs by spaces
|
|
"set expandtab
|
|
set noexpandtab
|
|
|
|
" Sets tab length in spaces
|
|
set softtabstop=4
|
|
set tabstop=4
|
|
set shiftwidth=4
|
|
|
|
" Highlights while searching
|
|
set hlsearch
|
|
set incsearch
|
|
|
|
let g:grammalecte_cli_py='/home/brume/Documents/Grammalecte-fr-v2.1.1/grammalecte-cli.py'
|
|
|
|
"
|
|
" Some key remaps
|
|
"
|
|
|
|
" disable fucking Ex mode
|
|
map Q <Nop>
|
|
|
|
let mapleader = ' '
|
|
|
|
" Leader-s : Save a file
|
|
map <leader>s :w<cr>
|
|
|
|
" Leader-w (+hjkl) : Switch window
|
|
map <leader>w <c-w>
|
|
|
|
" Leader-t (+file) : Opens the specified file in a new tab
|
|
map <leader>t :tabnew<cr>
|
|
|
|
" Leader-m(t|T) : moves the tab to the left or right
|
|
map <leader>mt :tabmove -<cr>
|
|
map <leader>mT :tabmove +<cr>
|
|
|
|
" Leader-p : parses the file with the php preprocessor
|
|
map <leader>p :!php -l %<CR>
|
|
|
|
" Leader-c : Tries to compile and run with cargo
|
|
map <leader>c :!cargo run<CR>
|
|
|
|
" Leader-l : returns the list of opened buffers.
|
|
map <leader>l :buffers<CR>
|
|
|
|
" Leader-j (buffer name) : switches to an opened buffer.
|
|
map <leader>j :buffer
|
|
|
|
" Leader-h : disables highlights
|
|
map <leader>h :noh<CR>
|
|
|
|
" Leader-f : tmux. (??????)
|
|
|
|
" Leader-e : Opens a file
|
|
map <leader>e :e
|
|
|
|
" R : inserts a char
|
|
map R i_<Esc>r
|
|
|
|
" X : throws a character into the depths of oblivion
|
|
map X "_x
|
|
|
|
"map <leader>start !sudo firejail /etc/init.d/apache2 start | !sudo firejail /etc/init.d/mysql start
|
|
" Ctrl+U : redo changes. alias of Ctrl+R
|
|
" nnoremap <c-u> <c-r>
|
|
|
|
" ZA : saves a file without clossing it
|
|
" nnoremap ZA :w<cr>
|
|
|
|
" ZSA : saves a file as root
|
|
" nnoremap ZSA hw !sudo tee %<cr>
|
|
|
|
"nnoremap "+y y:call system("wl-copy", @")<cr>
|
|
"nnoremap P :let @"=substitute(system("wl-paste --no-newline"), '<C-v><C-m>', '', 'g')<cr>p
|
|
|
|
" Y : super-yank - copies text to system clipboard
|
|
"nnoremap Y "+yy
|
|
|
|
" P : super-paste - pastes text from system clipboard
|
|
nnoremap P "+p
|
|
|
|
|
|
" some structures!
|
|
map <leader><leader>i iif ()<cr>{<cr><cr>}<Esc>kkklllli
|
|
map <leader><leader>e ielse<cr>{<cr><cr>}<Esc>kA<tab>
|
|
map <leader><leader>f ifor ()<cr>{<cr><cr>}<Esc>kkkllllli
|
|
|
|
""""""""""""""""""""""'
|
|
|
|
" Important!!
|
|
if has('termguicolors')
|
|
set termguicolors
|
|
endif
|
|
|
|
" The configuration options should be placed before `colorscheme sonokai`.
|
|
let g:sonokai_style = 'andromeda'
|
|
let g:sonokai_better_performance = 1
|
|
let g:sonokai_disable_italic_comment = 1
|
|
colorscheme sonokai
|