diff --git a/nvim/coc-settings.json b/nvim/coc-settings.json deleted file mode 100644 index 62f9cc9..0000000 --- a/nvim/coc-settings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "inlayHint": { - "enable": false - }, - "languageserver": { - "rust": { - "command": "rustup", - "args": ["run", "stable", "rust-analyzer"], - "filetypes": ["rust"], - "rootPatterns": ["Cargo.toml"] - }, - "elmLS": { - "command": "elm-language-server", - "filetypes": ["elm"], - "rootPatterns": ["elm.json"] - }, - "python": { - "command": "pylsp", - "filetypes": ["python"] - }, - "typscript": { - "command": "typescript-language-server", - "args": ["--stdio"], - "filetypes": ["typescript"] - } - } -} diff --git a/nvim/init.lua b/nvim/init.lua index fddf848..4ae6c7b 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -41,12 +41,12 @@ vim.opt.list = true vim.opt.listchars = { trail = '·', tab = ' ', nbsp = '¬' } -- Auto remove trailing spaces -vim.api.nvim_create_autocmd({'BufWritePre'}, { - pattern = {'*'}, - callback = function(ev) - vim.cmd('%s/\\s\\+$//e') - end -}) +-- vim.api.nvim_create_autocmd({'BufWritePre'}, { +-- pattern = {'*'}, +-- callback = function(ev) +-- vim.cmd('%s/\\s\\+$//e') +-- end +-- }) -- COLOR -- pcall(vim.cmd.colorscheme, 'peach') diff --git a/nvim/init.vim b/nvim/init.vim deleted file mode 100644 index 02f95f9..0000000 --- a/nvim/init.vim +++ /dev/null @@ -1,230 +0,0 @@ -" Pas de compatibilité a VI ! -set nocompatible - -" PLUGNIS ###########################################################{{{ -call plug#begin() - -" Conquer of Completion -Plug 'neoclide/coc.nvim', {'branch': 'release'} - -" General plugins -Plug 'vim-airline/vim-airline' -Plug 'vim-airline/vim-airline-themes' -Plug 'https://gitea.tforgione.fr/tforgione/peach.git' -Plug 'scrooloose/nerdtree' -Plug 'tpope/vim-abolish' -Plug 'lambdalisue/suda.vim' - -" Language specific plugins - -" Rust -Plug 'rust-lang/rust.vim' - -" Elm -Plug 'ElmCast/elm-vim' - -" Toml -Plug 'cespare/vim-toml' - -" Pug -Plug 'digitaltoad/vim-pug' - -" Typst -Plug 'kaarmu/typst.vim' - -call plug#end() - -" Line numbers and syntaxic coloration -" set nu -" syntax on - -" Highlight bad spaces (not working...) -" }}} - -" INDENTATION #######################################################{{{ -set expandtab -set tabstop=4 -set shiftwidth=4 -set autoindent -set tw=120 -if !empty($NVIM_TEXT_WIDTH) - execute 'set tw=' . $NVIM_TEXT_WIDTH -endif -" }}} - -" UI CONFIG #########################################################{{{ -set number -if $NVIM_LINE_NUMBER == 'rnu' - set rnu -endif -set showcmd -set wildmenu -set lazyredraw -set encoding=utf8 -set clipboard=unnamedplus -set updatecount=50 -set mouse=a -set guicursor= -" set ttymouse=sgr -" Espaces insécables grrrr -set list -set listchars=tab:  ,trail:·,extends:>,precedes:<,nbsp:¬ -" Remove trailing spaces -autocmd BufWritePre * :%s/\s\+$//e - -" Compile on F12 -if executable('mars') - nnoremap :wa \| !mars -p %:p - inoremap :wa \|!mars -p %:p - vnoremap :wa \|!mars -p %:p -elseif executable('make') - nnoremap :wa \| !make -p %:p - inoremap :wa \|!make -p %:p - vnoremap :wa \|!make -p %:p -endif - -" SudaWrite with W -command W SudaWrite - -" Escape on F1 -map -imap -" vim airline config -set laststatus=2 -let g:airline_powerline_fonts = 1 -let g:airline#extensions#branch#format = 1 -let g:airline_theme='dark' -set t_Co=256 -set textwidth=0 -" Set textwidth for latex -" autocmd FileType tex set textwidth=79 -autocmd FileType markdown set textwidth=120 -" }}} - -" COLOR #############################################################{{{ -set background=dark -syntax enable -try - colorscheme peach -catch -endtry -highlight BadWhitespace ctermbg=red guibg=red -match BadWhitespace / \| \+\t/ - -" Use html for tera files -autocmd BufNewFile,BufRead *.tera set ft=html -" }}} - -" SEARCHING #########################################################{{{ -set title -set showmatch -set hlsearch -set noincsearch -" }}} - -" NERDTREE ##########################################################{{{ -let NERDTreeIgnore = ['\.pyc$','__pycache__'] -set shell=zsh -let g:NERDTreeIndicatorMapCustom = { - \ "Modified" : "✹", - \ "Staged" : "✚", - \ "Untracked" : "✭", - \ "Renamed" : "➜", - \ "Unmerged" : "═", - \ "Deleted" : "✖", - \ "Dirty" : "✗", - \ "Clean" : "✔︎", - \ "Unknown" : "?" - \ } -let g:WebDevIconsNerdTreeGitPluginForceVAlign = 1 -" }}} - -" BACKUPS ###########################################################{{{ -set dir=$HOME/.nvim/swp// -autocmd BufWritePost * :silent execute ':w! ' ."$HOME/.nvim/backups/" . substitute(escape(substitute(expand('%:p'), "/", "%", "g"), "%"), ' ', '\\ ', 'g') - -if exists('+undofile') - set undofile - set undolevels=1000 - set undoreload=10000 - if exists('+undodir') - set undodir=$HOME/.nvim/undo - endif -endif -" }}} - - -" MARKDOWN PREVIEW ##################################################{{{ -let g:markdown_composer_browser = 'firefox' -let g:instant_markdown_autostart = 0 -" }}} - -" COC CONFIG ########################################################{{{ - -" Use `[g` and `]g` to navigate diagnostics -" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. -nmap gp (coc-diagnostic-prev) -nmap gn (coc-diagnostic-next) - -" GoTo code navigation. -nmap gd (coc-definition) -nmap gy (coc-type-definition) -nmap gi (coc-implementation) -nmap gr (coc-references) - -" Add `:Format` command to format current buffer. -command! -nargs=0 Format :call CocAction('format') - -" Use K to show documentation in preview window. -nnoremap K :call show_documentation() - - -function! s:show_documentation() - if (index(['vim','help'], &filetype) >= 0) - execute 'h '.expand('') - elseif (coc#rpc#ready()) - call CocActionAsync('doHover') - else - execute '!' . &keywordprg . " " . expand('') - endif -endfunction - -" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable -" delays and poor user experience. -set updatetime=300 - -" Highlight the symbol and its references when holding the cursor. -autocmd CursorHold * silent call CocActionAsync('highlight') - -" Symbol renaming. -nmap rn (coc-rename) - -" Formatting selected code. -xmap f (coc-format-selected) -nmap f (coc-format-selected) - -" Autoclose preview -autocmd CursorMovedI * if pumvisible() == 0|pclose|endif -autocmd InsertLeave * if pumvisible() == 0|pclose|endif - -" Complete on tab -" inoremap pumvisible() ? "\" : "\" -function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~ '\s' -endfunction - -" Insert when previous text is space, refresh completion if not. -inoremap - \ coc#pum#visible() ? coc#pum#next(1): - \ check_back_space() ? "\" : - \ coc#refresh() -inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" -" }}} - -" CUSTOM THINGS DEPENDING ON ENV ####################################{{{ -let g:rustfmt_autosave = 1 - - -" Apprently some people don't use vim -" set autoread | au CursorHold * checktime | call feedkeys("lh")