From f63208096bd0b5623692839a7091e99008ef5e0a Mon Sep 17 00:00:00 2001 From: Oxbian Date: Thu, 9 May 2024 19:22:20 +0200 Subject: FIX: symlink glitch + removing unused plugins from README --- vim/after/ftplugin/markdown.vim | 1 - vim/after/ftplugin/python.vim | 30 ------- vim/keymaps.vim | 187 ---------------------------------------- vim/options.vim | 82 ------------------ vim/plugins.vim | 131 ---------------------------- vim/spell/en.utf-8.add | 11 --- vim/spell/en.utf-8.add.spl | Bin 211 -> 0 bytes vim/spell/fr.utf-8.spl | Bin 571627 -> 0 bytes vim/spell/fr.utf-8.sug | Bin 2324315 -> 0 bytes 9 files changed, 442 deletions(-) delete mode 100644 vim/after/ftplugin/markdown.vim delete mode 100644 vim/after/ftplugin/python.vim delete mode 100644 vim/keymaps.vim delete mode 100644 vim/options.vim delete mode 100644 vim/plugins.vim delete mode 100644 vim/spell/en.utf-8.add delete mode 100644 vim/spell/en.utf-8.add.spl delete mode 100644 vim/spell/fr.utf-8.spl delete mode 100644 vim/spell/fr.utf-8.sug (limited to 'vim') diff --git a/vim/after/ftplugin/markdown.vim b/vim/after/ftplugin/markdown.vim deleted file mode 100644 index bcda2dd..0000000 --- a/vim/after/ftplugin/markdown.vim +++ /dev/null @@ -1 +0,0 @@ -setlocal spell diff --git a/vim/after/ftplugin/python.vim b/vim/after/ftplugin/python.vim deleted file mode 100644 index 41b1d88..0000000 --- a/vim/after/ftplugin/python.vim +++ /dev/null @@ -1,30 +0,0 @@ -" Python -let g:lsp_settings = {} -let g:lsp_settings['pylsp-all'] = - \ { - \ 'workspace_config': {'pylsp-all': { - \ 'configurationSources': ['flake8'], - \ 'plugins': { - \ 'pyflakes' : {'enabled': v:false}, - \ 'flake8': {'enabled': v:true}, - \ 'mypy-ls': {'enabled': v:true, 'live_mode': v:false}, - \ 'pylint': {'enabled': v:true}, - \ 'pydocstyle': {'enabled': v:true}, - \ 'pyls_isort': {'enabled': v:true}, - \ 'autopep8': {'enabled': v:false}, - \ 'yapf': {'enabled': v:false}, - \ 'black': {'enabled': v:true}, - \ } - \ }} - \ } - -" Define a custom function that executes :LspDocumentFormat and :!isort -if !exists('*FormatPythonFile') - function! FormatPythonFile() - silent execute '!black %' - silent execute '!isort %' - endfunction -endif -" Remap the custom function to ldf -nnoremap ldf :call FormatPythonFile() - diff --git a/vim/keymaps.vim b/vim/keymaps.vim deleted file mode 100644 index d68b8c4..0000000 --- a/vim/keymaps.vim +++ /dev/null @@ -1,187 +0,0 @@ -""""""""""""""""""""""""""""" -" Keymaps -""""""""""""""""""""""""""""" - -let g:mapleader = "\" -let g:maplocalleader = ',' -nnoremap :WhichKey '' -nnoremap :WhichKey ',' - -" Treat long paragraph as a line -map j gj -map k gk - -"""""""""""""""""""" -" Window movement -"""""""""""""""""""" - -" Go to the bottom window -noremap j - -" Go to the top window -noremap k - -" Go to the right window -noremap l - -" Go to the left window -noremap h - -"""""""""""""""""""""""" -" Remove highlighting -"""""""""""""""""""""""" - -nnoremap hl :nohlsearch - -" Save file -nnoremap :w! - -"""""""""""""""""""""""""" -" Buffer -""""""""""""""""""""""""" - -" Close the current buffer -noremap bd :Bclose:tabclosegT - -" Close all the buffers -noremap ba :bufdo bd - -" Go to the next buffer -noremap bn :bnext - -" Go to the previous buffer -noremap bp :bprevious - -"""""""""""""""""""""""""""" -" Tabs -""""""""""""""""""""""""""" - -" Open a new tab -noremap tn :tabnew - -" Close all others tab -noremap to :tabonly - -" Close current tab page -noremap tc :tabclose - -" Move tabs after another -noremap tm :tabmove - -" Go to the next tab -noremap t :tabnext - -" Let 'tl' toggle between this and the last accessed tab -let g:lasttab = 1 -nnoremap tl :exe "tabn ".g:lasttab -au TabLeave * let g:lasttab = tabpagenr() - -" Opens a new tab with the current buffer's path -" Super useful when editing files in the same directory -noremap te :tabedit =escape(expand("%:p:h"), " ")/ - -" Switch CWD to the directory of the open buffer -noremap cd :cd %:p:h:pwd - -" Specify the behavior when switching between buffers -try - set switchbuf=useopen,usetab,newtab - set stal=2 -catch -endtry - -" Return to last edit position when opening files (You want this!) -au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif - -"""""""""""""""""""""""" -" Netrw -""""""""""""""""""""""" - -" Toggle tree view -nnoremap :Lexplore - -"""""""""""""""""""" -" GitGutter -"""""""""""""""""""" - -let g:gitgutter_enabled=1 " Enable by default gitgutter - -" Go to the previous hunk -nnoremap hp (GitGutterPrevHunk) - -" Go to the next hunk -nnoremap hn (GitGutterNextHunk) - -" Enable / Disable GitGutter -nnoremap ht (GitGutterToggle) - -" Stage Hunk in Git -nnoremap hs (GitGutterStageHunk) - -" Undo Hunk -nnoremap hu (GitGutterUndoHunk) - -" Preview Hunk -nnoremap hP :GitGutterPreviewHunk - -" Always show the status line -set laststatus=2 - -""""""""""""""""""""" -" Spell -""""""""""""""""""""" - -" Toggle and untoggle spell checking -noremap ss :setlocal spell! - -" Next word to spellcheck -noremap sn ]s - -" Previous word to spellcheck -noremap sp [s - -" Add word into the spellcheck dictionary -noremap sa zg - -" show the list of alternatives for the word -noremap s? z= - -""""""""""""""""""" -" LSP -""""""""""""""""""" -inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" - -" Make to accept selected completion item or notify coc.nvim to format -" u breaks current undo, please make your own choice -inoremap coc#pum#visible() ? coc#pum#confirm() - \: "\u\\=coc#on_enter()\" - -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) - -" Use K to show documentation in preview window -nnoremap gh :call ShowDocumentation() - -function! ShowDocumentation() - if CocAction('hasProvider', 'hover') - call CocActionAsync('doHover') - else - call feedkeys('K', 'in') - endif -endfunction - -" Highlight the symbol and its references when holding the cursor -autocmd CursorHold * silent call CocActionAsync('highlight') - -" Symbol renaming -nmap gR (coc-rename) - -" Formatting selected code -xmap gf (coc-format-selected) -nmap gf (coc-format-selected) diff --git a/vim/options.vim b/vim/options.vim deleted file mode 100644 index 5e3f11a..0000000 --- a/vim/options.vim +++ /dev/null @@ -1,82 +0,0 @@ -" Search options -set incsearch " Search for partial typed match -set ignorecase " Search not case sensitive -set smartcase " Search for pattern if contains uppercase -set hlsearch " Highlight all match search pattern - -" Graphics options -syntax on " Show syntax color -set number " Show line number -set colorscheme=onedark " Set vim theme to onedark -set colorcolumn=80 " Add an indicator for 80 char limit -set relativenumber " Show relative line number -set cursorline " Select the current line -set showmatch " Show matching brackets when hovered -set noshowmode " Disable the -- INSERTION -- default comment -set so=7 " Set 7 lines to the cursor - when moving vertically - -" Mouse options -set mouse=a " Allow the mouse to do all the editing - -" Indent options -set tabstop=4 " Size of a tab -set shiftwidth=4 " Number of space for each indent -set softtabstop=0 " Useless indent -set noexpandtab " Vim will automatically use tab and not spaces -set smartindent " Do clever indenting -set copyindent " Copy indent style of the file -" Automatic options -set autowrite " Automatically write the file on certain actions -set autoread " Automatically read external changes on the file - -" System -if has('unnamedplus') " Allow OS & vim clipboard sync - set clipboard=unnamedplus -endif -set undofile " Save undo history -set history=500 " Max line vim remember -set updatetime=500 " Delay before vim write swap file, better for gitgutter - -" Autocomplete -set completeopt=menu,menuone,popup,noselect,noinsert " Show a pop up for - " command completion -set wildmenu " Turn on wildmenu -filetype plugin on - -" Avoid garbled characters in Chinese language windows OS -let $LANG='en' " Setting lang as en -set langmenu=en " Setting menu lang as en -" This delete all the defined menu -source $VIMRUNTIME/delmenu.vim -source $VIMRUNTIME/menu.vim - -" Ignore compiled files -set wildignore=*.o,*~,*.pyc -if has("win16") || has("win32") - set wildignore+=.git\*,.hg\*,.svn\* -else - set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store -endif - -" Configure backspace so it acts as it should act -set backspace=eol,start,indent -set whichwrap+=<,>,h,l - -" Don't redraw while executing macros (good performance config) -set lazyredraw - -" How many tenths of a second to blink when matching brackets -set mat=2 - -" Set UTF-8 as standard encoding and en_US as the standard language -set encoding=utf8 - -" Use Unix as the standard file type -set ffs=unix,dos,mac - -" Turn backup off, since most stuff is in SVN, git etc. anyway... -set nobackup -set noswapfile - -" Timeout -set timeoutlen=500 diff --git a/vim/plugins.vim b/vim/plugins.vim deleted file mode 100644 index 7dd1f9a..0000000 --- a/vim/plugins.vim +++ /dev/null @@ -1,131 +0,0 @@ -"""""""""""""""""""""""""" -" Plugins -"""""""""""""""""""""""""" -" Install vim-plug if not found -if empty(glob('~/.vim/autoload/plug.vim')) - silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs - \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -endif - -" Run PlugInstall if there are missing plugins -autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) - \| PlugInstall --sync | source $MYVIMRC -\| endif - -call plug#begin('~/.vim/plugged') - -" UI & Themes -Plug 'joshdick/onedark.vim' " Onedark themes for vim -Plug 'liuchengxu/vim-which-key' " Show leader mapping cheatsheet - -" Git integration -Plug 'airblade/vim-gitgutter' " Git diff - -" Autocompletion, linter, syntax -Plug 'neoclide/coc.nvim', {'branch': 'release'} - -" Tools -Plug 'wakatime/vim-wakatime' " Wakatime -Plug 'ap/vim-css-color' " rgb, hex color preview - -call plug#end() - -filetype plugin indent on " Allow filetype detection, plugins, indentation - -""""""""""""""""""""""""" -" Configuration -""""""""""""""""""""""""" -" Netrw (filetree built-in vim) -let g:netrw_keepdir = 0 " Reload buffer usefull when moving or removing file -let g:netrw_winsize = 10 " Size of filetree buffer -let g:netrw_banner = 0 " Removing netrw banner -let g:netrw_localcopydircmd = 'cp -r' " Changing copy command to add recursive copy - -" Statusline -let g:currentmode={ - \ 'n' : 'NORMAL ', - \ 'v' : 'VISUAL ', - \ 'V' : 'V·Line ', - \ "\" : 'V·Block ', - \ 'i' : 'INSERT ', - \ 'R' : 'R ', - \ 'Rv' : 'V·Replace ', - \ 'c' : 'Command ', - \} -set laststatus=2 -set statusline= -" VIM Mode -set statusline+=\ %{toupper(g:currentmode[mode()])}%{&spell?'[SPELL]':''}\| -" File (path, modified, readonly ? ) -set statusline+=%h\ %F -set statusline+=%{&modified?'\ [+]':''} -set statusline+=%{&readonly?'\ ':''} -" Filetype -set statusline+=%=%y -set statusline+=\ \|\ %{&fileencoding?&fileencoding:&encoding} -set statusline+=\ \|\ [%{&fileformat}\] -" Line count and percentage -set statusline+=\ \|\ %l:%c -set statusline+=\ [%p%%]\ - - -" Which Key -call which_key#register('', "g:which_key_map") -let g:which_key_map = {} - -" Buffer key help -let g:which_key_map.b = { - \ 'name' : '+buffer', - \ 'd' : 'current buffer close', - \ 'a' : 'close all buffers', - \ 'n' : 'go to next buffer', - \ 'p' : 'go to previous buffer', - \ } - -" Tab key help -let g:which_key_map.t = { - \ 'name' : '+tab', - \ 't' : 'go to next tab', - \ 'n' : 'open new tab', - \ 'o' : 'close other tabs', - \ 'c' : 'close current tab', - \ 'm' : 'move tab after another', - \ 'l' : 'switch between this & last tab', - \ 'e' : 'open new tab with current buffer', - \ } - -" Spell key help -let g:which_key_map.s = { - \ 'name' : '+spell', - \ 's' : 'toggle spell check', - \ 'n' : 'next spell word', - \ 'p' : 'previous spell word', - \ 'a' : 'add word in dict', - \ '?' : 'list word alternatives', - \ } - -" Hunk key help -let g:which_key_map.h = { - \ 'name' : '+git hunk', - \ 'l' : 'remove highlight', - \ 'p' : 'go previous hunk', - \ 'n' : 'go next hunk', - \ 't' : 'enable/disable gitgutter', - \ 's' : 'stage hunk', - \ 'u' : 'undo hunk', - \ 'P' : 'preview hunk', - \ } - -" LSP key help -let g:which_key_map.g = { - \ 'name' : '+LSP', - \ 'd' : 'go to definition', - \ 'n' : 'next diagnostic', - \ 'p' : 'previous diagnostic', - \ 'r' : 'go to reference', - \ 'R' : 'rename object', - \ 'y' : 'type definition', - \ 'i' : 'go to implementation', - \ 'h' : 'documentation', - \ 'f' : 'format document', - \ } diff --git a/vim/spell/en.utf-8.add b/vim/spell/en.utf-8.add deleted file mode 100644 index 283920b..0000000 --- a/vim/spell/en.utf-8.add +++ /dev/null @@ -1,11 +0,0 @@ -linters -nerdtree -GitGutter -keybinds -onedark -LSP -vscode -autocompleter -linter -neovim -untoggle diff --git a/vim/spell/en.utf-8.add.spl b/vim/spell/en.utf-8.add.spl deleted file mode 100644 index 29528b3..0000000 Binary files a/vim/spell/en.utf-8.add.spl and /dev/null differ diff --git a/vim/spell/fr.utf-8.spl b/vim/spell/fr.utf-8.spl deleted file mode 100644 index ff27132..0000000 Binary files a/vim/spell/fr.utf-8.spl and /dev/null differ diff --git a/vim/spell/fr.utf-8.sug b/vim/spell/fr.utf-8.sug deleted file mode 100644 index df555d2..0000000 Binary files a/vim/spell/fr.utf-8.sug and /dev/null differ -- cgit v1.2.3