From cbd598d9df1e63148fe1860937e03079656dbea5 Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Wed, 24 Jun 2020 22:42:55 +0200 Subject: [PATCH] Add some modifications to config files and clean code. --- vim/vim/functions.vim | 39 +++- vim/vim/keybindings.vim | 165 ++++++++++---- vim/vim/plug.vim | 89 ++++++-- vim/vimrc | 488 ++++++++++++++++++++++++++++++---------- 4 files changed, 607 insertions(+), 174 deletions(-) diff --git a/vim/vim/functions.vim b/vim/vim/functions.vim index 73900d2..23082e4 100644 --- a/vim/vim/functions.vim +++ b/vim/vim/functions.vim @@ -1,7 +1,7 @@ " File : functions.vim " Author : Jeff LANCE " Date : 15.04.2015 -" Last Modified Date: 28.04.2020 +" Last Modified Date: 24.06.2020 " Last Modified By : Jeff LANCE """"""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -40,8 +40,9 @@ function! WinMove(key) endif endfunction + " Count buffers -function! CountBuf() +function! CountBuffers() let bufcount = 0 for buf in getbufinfo() let bufcount += 1 @@ -49,26 +50,32 @@ function! CountBuf() return bufcount endfunction + " Test if current buffer is netrw buffer -function! IsNetrw() - if (getbufvar('%', '&filetype') == "netrw" || bufname('%') =~ 'NetrwTreeListing') +function! IsExplorerBuffer() + if (getbufvar('%', '&filetype') == "netrw" + \ || bufname('%') =~ 'NetrwTreeListing' + \ || bufname('%') =~ '[defx] defxplorer-0') return 1 endif return 0 endfunction + " Test if current buffer is empty -function! IsEmptyBuf() +function! IsEmptyBuffer() if (bufname('%') == '') return 1 endif return 0 endfunction + " Close current buffer -" If empty return to Startify +" If the last buffer is closed go back to Startify function! BufClose() - if (IsEmptyBuf() || IsNetrw()) + if (CountBuffers() == 1 || IsExplorerBuffer() || IsEmptyBuffer()) + bwipeout Startify else bwipeout @@ -76,3 +83,21 @@ function! BufClose() endfunction +" COC functions +" +function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + + +function! s:show_documentation() + if (index(['vim','help'], &filetype) >= 0) + execute 'h '.expand('') + else + call CocAction('doHover') + endif +endfunction + + + diff --git a/vim/vim/keybindings.vim b/vim/vim/keybindings.vim index 6eadc8c..63f66a4 100644 --- a/vim/vim/keybindings.vim +++ b/vim/vim/keybindings.vim @@ -1,7 +1,7 @@ " File : keybindings.vim " Author : Jeff LANCE " Date : 15.04.2015 -" Last Modified Date: 28.04.2020 +" Last Modified Date: 24.06.2020 " Last Modified By : Jeff LANCE """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -13,9 +13,8 @@ " """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" -" Custom -" +" Custom {{{ +" ----- " Disable highlights when you press : map :noh @@ -27,11 +26,21 @@ nnoremap za map s :echom 'Source file' :so % " Two semicolons to escape -" imap ;; +imap ;; + +" Open a current file with sudo +map E :e suda://% + +" Save a current file with sudo +map W :w suda://% + +" ----- +" }}} + + +" Buffers {{{ +" ----- -" -" Buffers -" command! -bang -nargs=? -complete=dir Files \ call fzf#vim#files( \ , @@ -41,31 +50,81 @@ command! -bang -nargs=? -complete=dir Files \ 0 \ ) map :echom 'Close buffer' :call BufClose() -map :echom 'Force close buffer' bwipeout! map :e map :enew map :bn map :bp -" -" Windows -" +" ----- +" }}} + + +" Windows {{{ +" ----- + map :call WinMove('h') map :call WinMove('j') map :call WinMove('k') map :call WinMove('l') -" -" Tabs -" +" ----- +" }}} + + +" Tabs {{{ +" ----- + map tn :tabnew map tc :tabclose map :tabnext map :tabnext -" -" Defx -" +" ----- +" }}} + + +" COC {{{ +" ----- + +" Use tab for trigger completion with characters ahead and navigate. +" NOTE: Use command ':verbose imap ' to make sure tab is not mapped by +" other plugin before putting this into your config. +inoremap + \ pumvisible() ? "\" : + \ check_back_space() ? "\" : + \ coc#refresh() +inoremap pumvisible() ? "\" : "\" + +" Use to confirm completion, `u` means break undo chain at current +" position. Coc only does snippet and additional edit on confirm. +" could be remapped by other vim plugin, try `:verbose imap `. +if exists('*complete_info') + inoremap complete_info()["selected"] != "-1" ? "\" : "\u\" +else + inoremap pumvisible() ? "\" : "\u\" +endif + +" Use `[g` and `]g` to navigate diagnostics +" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. +nmap [g (coc-diagnostic-prev) +nmap ]g (coc-diagnostic-next) + +" GoTo code navigation. +nmap gd (coc-definition) +nmap gy (coc-type-definition) +nmap gi (coc-implementation) +nmap gr (coc-references) + +" Use K to show documentation in preview window. +nnoremap K :call show_documentation() + +" ----- +" }}} + + +" Defx {{{ +" ----- + map :Defx function! s:defx_toggle_tree() abort @@ -145,40 +204,62 @@ function! s:defx_my_settings() abort \ defx#do_action('change_vim_cwd') endfunction +" ----- +" }}} + + +" FZF {{{ +" ----- -" -" FZF -" map :Files -" -" Header -" +" ----- +" }}} + + +" Header {{{ +" ----- + map :AddHeader -" -" REPL -" -nnoremap rp :REPLToggle -autocmd Filetype python nnoremap :REPLDebugStopAtCurrentLine -autocmd Filetype python nnoremap :REPLPDBN -autocmd Filetype python nnoremap :REPLPDBS +" ----- +" }}} + +"" REPL {{{ +"" ----- " -" Vimroom +"nnoremap rp :REPLToggle +"autocmd Filetype python nnoremap :REPLDebugStopAtCurrentLine +"autocmd Filetype python nnoremap :REPLPDBN +"autocmd Filetype python nnoremap :REPLPDBS " +"" ----- +"" }}} + + +" Vimroom {{{ +" ----- + nnoremap z :Goyo -" -" Vimux -" +" ----- +" }}} + + +" Vimux {{{ +" ----- + map vp :VimuxPromptCommand " map vr :VimuxRunCommand " map vo :VimuxOpenRunner -" -" Functions -" +" ----- +" }}} + + +" Functions {{{ +" ----- " Renaming map r :call RenameFile() @@ -187,8 +268,10 @@ map r :call RenameFile() map o :call GotoFile("") map ' ciw''P +map " c""P +" Rewrap paragraph using +map {gq}:echo "Rewrapped paragraph" - - - +" ----- +" }}} diff --git a/vim/vim/plug.vim b/vim/vim/plug.vim index f0a1a5d..6914981 100644 --- a/vim/vim/plug.vim +++ b/vim/vim/plug.vim @@ -1,7 +1,7 @@ " File : plug.vim " Author : Jeff LANCE " Date : 15.04.2015 -" Last Modified Date: 28.04.2020 +" Last Modified Date: 24.06.2020 " Last Modified By : Jeff LANCE """""""""""""""""""""""""""""""""""""""""""""""" @@ -13,6 +13,9 @@ " """""""""""""""""""""""""""""""""""""""""""""""" +" General {{{ +" ----- + " Install vim-plug if we don't already have it if empty(glob('~/.vim/autoload/plug.vim')) silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs @@ -25,75 +28,135 @@ endif " - Avoid using standard Vim directory names like 'plugin' call plug#begin('~/.vim/plugged') -" Startup sceen +" ----- +" }}} + + +" Plugins {{{ +" ----- + +" Startup screen Plug 'mhinz/vim-startify' + " Deoplete -if using_neovim +if has('nvim') Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'kristijanhusak/defx-icons' else Plug 'Shougo/deoplete.nvim' - Plug 'roxma/nvim-yarp' - Plug 'roxma/vim-hug-neovim-rpc' Plug 'Shougo/defx.nvim' Plug 'kristijanhusak/defx-icons' endif +Plug 'roxma/nvim-yarp' +Plug 'roxma/vim-hug-neovim-rpc' + " Buffer exploration -Plug 'ap/vim-buftabline', { 'as': 'buftabline' } +Plug 'bagrat/vim-buffet', { 'as': 'buffet' } + " Folding Plug 'Konfekt/FastFold' + " Markdown -Plug 'plasticboy/vim-markdown', { 'for': 'markdown' } +Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() } } +" Plug 'plasticboy/vim-markdown', { 'for': 'markdown' } + " Git integration Plug 'tpope/vim-fugitive' + " Quoting, etc... Plug 'tpope/vim-surround' + " Commenting shortcuts Plug 'tpope/vim-commentary' + +" Abolish +Plug 'tpope/vim-abolish' + +" " Vinegar +" Plug 'tpope/vim-vinegar' " Show hex codes as colors -Plug 'chrisbra/Colorizer' +" Plug 'chrisbra/Colorizer' +Plug 'norcalli/nvim-colorizer.lua' + " Put an header in file Plug 'alpertuna/vim-header' + " Latex support Plug 'lervag/vimtex' + " Open file Plug 'amix/open_file_under_cursor.vim' + " Python autocompletion -Plug 'deoplete-plugins/deoplete-jedi' +" Plug 'deoplete-plugins/deoplete-jedi' + " Completion from other opened files -Plug 'Shougo/context_filetype.vim' +" Plug 'Shougo/context_filetype.vim' + " Linting Plug 'dense-analysis/ale' -" REPL for vim -Plug 'sillybun/vim-repl' + " Auto-close char feature Plug 'Townk/vim-autoclose' + " Indexed search Plug 'vim-scripts/IndexedSearch' + " Git/mercurial/others diff icons on the side of the file lines Plug 'mhinz/vim-signify' + +" Golden resizing +Plug 'roman/golden-ratio' + " Fuzzy finder Plug 'junegunn/fzf' Plug 'junegunn/fzf.vim' + " Distraction-free writing Plug 'junegunn/goyo.vim' Plug 'junegunn/limelight.vim' + " Status line -Plug 'itchyny/lightline.vim' +Plug 'hardcoreplayers/spaceline.vim' +" Plug 'itchyny/lightline.vim' + " Tmux Plug 'edkolev/tmuxline.vim' Plug 'benmills/vimux' + " Colorschemes +" Plug 'wgwoods/vim-systemd-syntax' Plug 'nanotech/jellybeans.vim', { 'as': 'jellybeans' } Plug 'jdsimcoe/abstract.vim', { 'as': 'abstract' } Plug 'xero/sourcerer.vim', { 'as': 'sourcerer' } +Plug 'romainl/Apprentice', { 'as': 'apprentice' } +Plug 'jdsimcoe/hyper.vim', { 'as': 'hyper' } +Plug 'jacoborus/tender.vim', { 'as': 'tender' } +Plug 'connorholyday/vim-snazzy', { 'as': 'snazzy' } +Plug 'hardcoreplayers/oceanic-material', { 'as': 'oceanic' } + " Customization Plug 'ryanoasis/vim-devicons' +" Sudo workaround plugin +Plug 'lambdalisue/suda.vim' + +" Autocompletion +Plug 'neoclide/coc.nvim', {'branch': 'release'} + + +" Required {{{ +" ----- " required ! filetype plugin indent on " Initialize plugin system call plug#end() + +" ----- +" }}} + + + diff --git a/vim/vimrc b/vim/vimrc index a6a153e..5cb3284 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1,7 +1,7 @@ " File : vimrc " Author : Jeff LANCE " Date : 15.04.2015 -" Last Modified Date: 28.04.2020 +" Last Modified Date: 24.06.2020 " Last Modified By : Jeff LANCE """""""""""""""""""""""""""""""""""""""""""""" @@ -15,31 +15,121 @@ " """""""""""""""""""""""""""""""""""""""""""""""" -" some useful vars -let using_neovim = has('nvim') -let using_vim = !using_neovim - - +" General {{{ +" ----- set nocompatible " be iMproved, required filetype plugin indent on -" viminfo configuration -if using_vim - set viminfo='100,n$HOME/.vim/files/info/viminfo -endif -set backupdir=$HOME/.vim/backup -set directory=$HOME/.vim/tmp -set noswapfile -" UTF-8 +set mouse=nv " Disable mouse in command-line mode +set report=0 " Don't report on line changes +set errorbells " Trigger bell on error +set visualbell " Use visual bell instead of beeping +set hidden " hide buffers when abandoned instead of unload +set fileformats=unix,dos,mac " Use Unix as the standard file type +set magic " For regular expressions turn magic on +set path+=** " Directories to search when using gf and friends +set isfname-== " Remove =, detects filename in var=/foo/bar +set virtualedit=block " Position cursor anywhere in visual block +set synmaxcol=2500 " Don't syntax highlight long lines +set formatoptions+=1 " Don't break lines after a one-letter word +set formatoptions-=t " Don't auto-wrap text +set formatoptions-=o " Disable comment-continuation (normal 'o'/'O') + +" file encoding set encoding=utf8 " Syntax highlighting syntax on set synmaxcol=512 +" ----- +" }}} + + +" Vim Directories {{{ +" ----- +set nobackup +set nowritebackup +set undofile noswapfile +set directory=$DATA_PATH/swap//,$DATA_PATH,~/tmp,/var/tmp,/tmp +set undodir=$DATA_PATH/undo//,$DATA_PATH,~/tmp,/var/tmp,/tmp +set backupdir=$DATA_PATH/backup/,$DATA_PATH,~/tmp,/var/tmp,/tmp +set viewdir=$DATA_PATH/view/ +" Use the coc-spell-checker to do this +" set spellfile=$VIM_PATH/spell/en.utf-8.add + +" History saving +set history=2000 + +if has('nvim') && ! has('win32') && ! has('win64') + set shada=!,'300,<50,@100,s10,h +else + set viminfo='300,<10,@50,h,n$DATA_PATH/viminfo +endif + +augroup user_persistent_undo + autocmd! + au BufWritePre /tmp/* setlocal noundofile + au BufWritePre COMMIT_EDITMSG setlocal noundofile + au BufWritePre MERGE_MSG setlocal noundofile + au BufWritePre *.tmp setlocal noundofile + au BufWritePre *.bak setlocal noundofile +augroup END + +" If sudo, disable vim swap/backup/undo/shada/viminfo writing +if $SUDO_USER !=# '' && $USER !=# $SUDO_USER + \ && $HOME !=# expand('~'.$USER) + \ && $HOME ==# expand('~'.$SUDO_USER) + + set noswapfile + set nobackup + set noundofile + if has('nvim') + set shada="NONE" + else + set viminfo="NONE" + endif +endif + +" Secure sensitive information, disable backup files in temp directories +if exists('&backupskip') + set backupskip+=/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*,*/shm/*,/private/var/* + set backupskip+=.vault.vim +endif + +" Disable swap/undo/viminfo/shada files in temp directories or shm +augroup user_secure + autocmd! + silent! autocmd BufNewFile,BufReadPre + \ /tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*,*/shm/*,/private/var/*,.vault.vim + \ setlocal noswapfile noundofile nobackup nowritebackup viminfo= shada= +augroup END +" ----- +" }}} + + +" Timing {{{ +" ------ +set timeout ttimeout +set timeoutlen=500 " Time out on mappings +set ttimeoutlen=10 " Time out on key codes +set updatetime=100 " Idle time to write swap and trigger CursorHold +set redrawtime=1500 " Time in milliseconds for stopping display redraw +" ----- +" }}} + + +" Behaviour {{{ +" ----- " Set to auto read when a file is changed from the outside set autoread +" Netrw +let g:netrw_fastbrowse=0 + +" Use system clipboard +set clipboard=unnamedplus + " With a map leader it's possible to do extra key combinations " like w saves the current file let mapleader = ";" @@ -47,17 +137,9 @@ let mapleader = ";" " Fast saving nmap w :w! -" Allow saving of files as sudo when I forgot to start vim using sudo. -" ca w!! w !sudo tee "%" - -" A buffer becomes hidden when it is abandoned -set hidden - -" Use system clipboard -set clipboard=unnamedplus - -" Mouse -set mouse=a +" " Allow saving of files as sudo when I forgot to start vim using sudo. +" ca w!! w !sudo tee > /dev/null % +" nmap W :w!! " Auto change dir to current buffer dir autocmd BufEnter * silent! lcd %:p:h @@ -65,6 +147,9 @@ autocmd BufEnter * silent! lcd %:p:h " Delete extra blank line at the end of file " autocmd BufWritePre *.py normal m`:%s/\s\+$//e`` +" ----- +" }}} + """""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -80,17 +165,30 @@ autocmd BufEnter * silent! lcd %:p:h let fancy_symbols_enabled = 1 " Font config -set guifont=Inconsolata\ Nerd\ Font\ Mono\ 11 +if has('gui') + set guifont=RobotoMono\ Nerd\ Font\ Mono\ 12 +endif + +" Disable default status ruler +set noruler + +" Keep at least 2 lines above/below +set scrolloff=2 + +" hide ~ tila +set fcs=eob:\ " Remove ugly vertical lines on window division set fillchars+=vert:\ -" -set linespace=5 - " vim tab title -let &titlestring = @% set title +" Title length. +set titlelen=95 +" Title string. +let &g:titlestring=" + \ %{expand('%:p:~:.')}%(%m%r%w%) + \ %<\[%{fnamemodify(getcwd(), ':~')}\] - Neovim" " Show line numbers set number @@ -121,6 +219,10 @@ au BufNewFile,BufRead *.js, *.html, *.css \ set tabstop=2 \ set softtabstop=2 \ set shiftwidth=2 +" astroid format=flowed +au FileType mail setlocal tw=72 +au FileType mail setlocal fo+=q +au FileType mail setlocal comments+=nb:> " Let the cursor traverse to the previous or following line when at the or the " end of a line @@ -154,6 +256,25 @@ set guioptions-=L set spell set spelllang=fr,en +" Give more space for displaying messages. +set cmdheight=2 + +" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable +" delays and poor user experience. +set updatetime=300 + +" Don't pass messages to |ins-completion-menu|. +set shortmess=aFc + +" Always show the signcolumn, otherwise it would shift the text each time +" diagnostics appear/become resolved. +if has("patch-8.1.1564") + " Recently vim can merge signcolumn and number column into one + set signcolumn=number +else + set signcolumn=yes +endif + """"""""""""""""""""""""""""""""""""""""""" @@ -171,21 +292,20 @@ source $HOME/.vim/plug.vim " Start startify if no arg autocmd StdinReadPre * let s:std_in=1 autocmd VimEnter * - \ if argc() == 0 - \ && !exists("s:std_in") + \ if (argc() == 0 && !exists("s:std_in") && !has('gui')) \ | Startify \ | endif -" needed so deoplete can auto select the first suggestion -set completeopt+=noinsert -" comment this line to enable autocompletion preview window -" (displays documentation related to the selected completion option) -" disabled by default because preview makes the window flicker +" " needed so deoplete can auto select the first suggestion +" set completeopt+=noinsert +" " comment this line to enable autocompletion preview window +" " (displays documentation related to the selected completion option) +" " disabled by default because preview makes the window flicker " set completeopt-=preview -" autocompletion of files and commands behaves like shell -" (complete only the common part, list the options that match) -set wildmode=list:longest +" " autocompletion of files and commands behaves like shell +" " (complete only the common part, list the options that match) +" " set wildmode=list:longest @@ -215,10 +335,46 @@ endif " """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" General {{{ +" ----- + +let g:SnazzyTransparent = 1 let base16colorspace=256 " Access colors present in 256 colorspace" +if (has("termguicolors")) + set termguicolors +endif + +let $NVIM_TUI_ENABLE_TRUE_COLOR=1 set background=dark -" colorscheme abstract -colorscheme sourcerer +colorscheme snazzy + +" Pseudo-transparency for completion menu and floating windows +if &termguicolors + if exists('&pumblend') + set pumblend=10 + endif + if exists('&winblend') + set winblend=10 + endif +endif + +" ----- +" }}} + + +" Buffet {{{ +" ----- + +function! g:BuffetSetCustomColors() + hi! BuffetTab cterm=NONE ctermbg=NONE ctermfg=8 guibg=NONE guifg=#FFFFFF + hi! BuffetBuffer cterm=NONE ctermbg=NONE ctermfg=8 guibg=NONE guifg=#FFFFFF + hi! BuffetModBuffer cterm=NONE ctermbg=NONE ctermfg=8 guibg=NONE guifg=#FF0000 + hi! BuffetCurrentBuffer cterm=NONE ctermbg=NONE ctermfg=8 guibg=NONE guifg=#00FF00 + hi! BuffetModCurrentBuffer cterm=NONE ctermbg=NONE ctermfg=8 guibg=NONE guifg=#FF0000 + endfunction + + " ----- +" }}} @@ -232,15 +388,58 @@ colorscheme sourcerer " """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +"" BufTabLine {{{ +"" ----- " -" BufTabLine +"hi TabLineSel ctermbg=Red ctermfg=black guibg=Red guifg=black +"hi PmenuSel ctermbg=Black ctermfg=Red guibg=Black guifg=Red " -hi TabLineSel ctermbg=green ctermfg=black guibg=green guifg=black -hi PmenuSel ctermbg=white ctermfg=white guibg=white guifg=white +"" ----- +"" }}} + + +" Buffet {{{ +" ----- + +let g:buffet_always_show_tabline = 1 +let g:buffet_powerline_separators = 1 +let g:buffet_use_devicons = 1 +let g:buffet_tab_icon = "\uf00a" +let g:buffet_modified_icon = "+" +let g:buffet_left_trunc_icon = "\uf0a8" +let g:buffet_right_trunc_icon = "\uf0a9" + +" ----- +" }}} + + + +" COC {{{ +" ----- + +" Highlight the symbol and its references when holding the cursor. +autocmd CursorHold * silent call CocActionAsync('highlight') + +" Disable warnings +let g:coc_disable_startup_warning = 1 + +" ----- +" }}} + + +" Colorizer {{{ +" ----- + +let g:colorizer_auto_filetype='css,html' + +" ----- +" }}} + + + +" Defx {{{ +" ----- -" -" Defx -" " Set appearance call defx#custom#option( \ '_', { @@ -269,22 +468,31 @@ call defx#custom#column( \ } \ ) -" -" Deoplete -" -if using_neovim - let g:deoplete#enable_at_startup = 1 +" ----- +" }}} + + +" Deoplete {{{ +" ----- + +if has('nvim') + let g:deoplete#enable_at_startup = 0 endif -" -" FZF -" +" ----- +" }}} + + +" FZF {{{ +" ----- + " This is the default extra key bindings let g:fzf_action = { \ 'enter': 'e', \ 'ctrl-h': 'split', \ 'ctrl-v': 'vsplit' \ } + " Preview window let g:fzf_preview_window = 'right:60%' if has('nvim') && !exists('g:fzf_layout') @@ -293,64 +501,83 @@ if has('nvim') && !exists('g:fzf_layout') \| autocmd BufLeave set laststatus=2 showmode ruler endif -" -" Header -" +" ----- +" }}} + + +" Header {{{ +" ----- + let g:header_field_author = 'Jeff LANCE' let g:header_field_author_email = 'email@jefflance.me' let g:header_auto_add_header = 0 -" -" Lightline -" -let g:lightline = { - \ 'colorscheme': 'jellybeans', - \ 'active': { - \ 'left': [ [ 'mode', 'paste' ], - \ [ 'readonly', 'filename', 'modified' ] ], - \ 'right': [ [ 'lineinfo' ], - \ [ 'percent' ], - \ [ 'fileformat', 'fileencoding', 'filetype', 'kitestatus' ] ], - \ }, - \ 'component': { - \ 'readonly': '%{&readonly?"|":""}', - \ 'kitestatus': '%{kite#statusline()}', - \ }, - \ 'component_function': { - \ 'gitbranch': 'FugitiveHead' - \ }, - \ 'separator': { 'left': '', 'right': '' }, - \ 'subseparator': { 'left': '', 'right': '' } - \ } +" ----- +" }}} + +"" Lightline {{{ +"" ----- " -" Markdown review +"let g:lightline = { +" \ 'colorscheme': 'snazzy', +" \ 'active': { +" \ 'left': [ [ 'mode', 'paste' ], +" \ [ 'readonly', 'filename', 'gitstatus', 'modified' ] +" \ ], +" \ 'right': [ [ 'lineinfo' ], +" \ [ 'percent' ], +" \ [ 'fileformat', 'fileencoding', 'filetype', 'kitestatus' ] +" \ ] +" \ }, +" \ 'component': { +" \ 'readonly': '%{&readonly?"|":""}', +" \ 'kitestatus': '%{kite#statusline()}', +" \ 'gitstatus': '%{FugitiveStatusline()}' +" \ }, +" \ 'component_function': { +" \ 'gitbranch': 'FugitiveHead' +" \ }, +" \ 'separator': { 'left': '', 'right': '' }, +" \ 'subseparator': { 'left': '', 'right': '' } +" \ } " +"" ----- +"" }}} + + +" Markdown preview {{{ +" ----- + let vim_markdown_preview_toggle=1 let vim_markdown_preview_browser='x-www-browser' -" -" REPL -" -let g:repl_program = { - \ 'python': ['ipython'], - \ 'default': ['zsh'], - \ 'r': ['R'], - \ 'lua': ['lua'], - \ 'vim': ['vim -e'] - \ } -let g:repl_predefine_python = { - \ 'numpy': 'import numpy as np', - \ 'matplotlib': 'from matplotlib import pyplot as plt' - \ } -let g:repl_cursor_down = 1 -let g:repl_python_automerge = 1 -let g:repl_ipython_version = '7' -let g:repl_position = 3 +" ----- +" }}} + + +" Neovim {{{ +" ----- + +let g:python3_host_prog = '/usr/bin/python3' + +" ----- +" }}} + + +" Spaceline {{{ +" ----- + +let g:spaceline_seperate_style= 'slant-fade' +" let g:spaceline_colorscheme = 'snazzy' + +" ----- +" }}} + + +" Startify {{{ +" ----- -" -" Startify -" let g:startify_custom_header = 'startify#center(startify#fortune#cowsay())' let g:startify_session_dir = '~/.vim/session' let g:startify_lists = [ @@ -369,9 +596,23 @@ let g:startify_bookmarks = [ \ '~/Projets/latex/latex-homework' \ ] -" -" Tmuxline -" +" ----- +" }}} + + +" Suda {{{ +" ----- + +let g:suda#prompt = 'Mot de passe: ' +let g:suda_smart_edit = 1 + +" ----- +" }}} + + +" Tmuxline {{{ +" ----- + let g:tmuxline_preset = { \'a' : '#S', \'win' : ['#I', '#W'], @@ -388,19 +629,39 @@ let g:tmuxline_separators = { \ } let g:tmuxline_theme = 'sourcerer' -" -" TMux navigator -" +" ----- +" }}} + + +" TMux navigator {{{ +" ----- + let g:tmux_navigator_no_mappings = 1 let g:tmux_navigator_save_on_switch = 2 -" -" Vimroom -" +" ----- +" }}} + + +" Vimroom {{{ +" ----- + let g:goyo_width=200 let g:goyo_margin_top = 2 let g:goyo_margin_bottom = 2 +" ----- +" }}} + + +" Vimtex {{{ +" ----- + +let g:vimtex_compiler_progname = 'nvr' + +" ----- +" }}} + """"""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -413,7 +674,7 @@ let g:goyo_margin_bottom = 2 " """"""""""""""""""""""""""""""""""""""""""""""""""""""" -" Load fucntions from file +" Load functions from file source $HOME/.vim/functions.vim @@ -431,3 +692,4 @@ source $HOME/.vim/functions.vim source $HOME/.vim/keybindings.vim +