From 661ae62d3ce345be5d9ab00002558f26c3d9ab3d Mon Sep 17 00:00:00 2001 From: Diogo Peralta Cordeiro Date: Thu, 7 Sep 2023 17:05:49 +0100 Subject: [PATCH] [nvim] simplify conf and add latex support --- vim/.config/nvim/init.vim | 8 + vim/.vim/README.md | 197 ------------------- vim/.vim/UltiSnips/go_perso.snippets | 126 ------------ vim/.vim/UltiSnips/javascript_perso.snippets | 11 -- vim/.vim/UltiSnips/php_perso.snippets | 154 --------------- vim/.vim/UltiSnips/tex.snippets | 16 ++ vim/.vim/basic_header.vim | 9 - vim/.vim/install.sh | 27 --- vim/.vim/make_basic.sh | 3 - vim/.vim/rc.d/00-plugins.vim | 65 ++---- vim/.vim/rc.d/01-settings.vim | 6 +- vim/.vim/rc.d/02-theme.vim | 10 +- vim/.vim/rc.d/10-keymap-general.vim | 104 +--------- vim/.vim/rc.d/11-keymap-rtl.vim | 8 +- vim/.vim/rc.d/20-lightline.vim | 3 +- vim/.vim/rc.d/20-vdebug.vim | 3 - vim/.vim/rc.d/20-vimtex.vim | 10 + 17 files changed, 70 insertions(+), 690 deletions(-) create mode 100755 vim/.config/nvim/init.vim delete mode 100644 vim/.vim/README.md delete mode 100644 vim/.vim/UltiSnips/go_perso.snippets delete mode 100644 vim/.vim/UltiSnips/javascript_perso.snippets delete mode 100644 vim/.vim/UltiSnips/php_perso.snippets create mode 100644 vim/.vim/UltiSnips/tex.snippets delete mode 100644 vim/.vim/basic_header.vim delete mode 100755 vim/.vim/install.sh delete mode 100755 vim/.vim/make_basic.sh create mode 100644 vim/.vim/rc.d/20-vimtex.vim diff --git a/vim/.config/nvim/init.vim b/vim/.config/nvim/init.vim new file mode 100755 index 0000000..dcba947 --- /dev/null +++ b/vim/.config/nvim/init.vim @@ -0,0 +1,8 @@ +" ================================================== +" Source the files ~/.vim/rc.d/ +" ================================================== +for f in split(glob('~/.vim/rc.d/*.vim'), '\n') + exe 'source' f +endfor + +" vim:set et sw=2: diff --git a/vim/.vim/README.md b/vim/.vim/README.md deleted file mode 100644 index d907c80..0000000 --- a/vim/.vim/README.md +++ /dev/null @@ -1,197 +0,0 @@ -My Neovim setup -=============== - -My Neovim IDE setup for Python, Go, Rust, HTML, CSS, Javascript, Typescript, -gettext and more. - -Features ---------- - -* `init.vim` handling -* Incremental and smart case search. -* Sublime Text style multiple selections -* Trailing whitespace highlighting and cleaning shortcut -* Logical and Visual layout (for Right-To-Left lanaguegs) editing. -* Tabs expand to 4 spaces by default -* Remap `` to `` and `jj` to `` -* Highlight current row and color column 80 -* 70+ language packs support -* Syntax checking -* Snippets -* Quotes, parens etc pair, surround -* Extended pair matching with % -* ASCII drawing -* Fuzzy file, buffer, mru, tag, etc finder -* VCS plugins (Fugitive, Lawrencium) -* Tab completion -* Commenting - -Prerequisites -------------- - -- Neovim and Neovim Python client. -- For faster search, [ripgrep](https://github.com/BurntSushi/ripgrep) -- For tags: [ctags](http://ctags.sourceforge.net) -- For devicons, a patched font, like the one from - [nerd-fonts](https://github.com/ryanoasis/nerd-fonts) - -Usage ------------- - -The following commands will clone the repo, and install `vim-plug` plugin -manager: - - mkdir -p ~/.config/nvim - git clone https://github.com/MeirKriheli/dotneovim.git ~/.config/nvim - curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \ - https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - - -Install plugins from the command line: - - nvim +PlugUpdate +qa - - -After that, [install the desired COC plugins or extensions](https://github.com/neoclide/coc.nvim). - -Overrides ----------------- - -* `~/.config/nvim/before.vim`, if exists, is sourced before everything allowing - definitions of variables to act upon. -* `~/.config/nvim/after.vim` if exists, is sourced after all the files in - `~/.config/nvim/rc.d` allowing override of default settings (e.g: color - schemes, plugin configuration, etc.). - - -Go tags ----------- - -For CtrlPBufTag search in go files, make sure you have an updated version -of ``ctags`` (>=5.8) and put in your ``~/.ctags``:: - - --langdef=Go - --langmap=Go:.go - --regex-Go=/func([ \t]+\([^)]+\))?[ \t]+([a-zA-Z0-9_]+)/\2/f,func/ - --regex-Go=/var[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/v,var/ - --regex-Go=/type[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/t,type/ - - -Rust tags -------------------------- - -For Rust ctags to wok (e.g: TagBar), put in your ``~/.ctags``:: - - --langdef=Rust - --langmap=Rust:.rs - --regex-Rust=/^[ \t]*(#\[[^\]]\][ \t]*)*(pub[ \t]+)?(extern[ \t]+)?("[^"]+"[ \t]+)?(unsafe[ \t]+)?fn[ \t]+([a-zA-Z0-9_]+)/\6/f,functions,function definitions/ - --regex-Rust=/^[ \t]*(pub[ \t]+)?type[ \t]+([a-zA-Z0-9_]+)/\2/T,types,type definitions/ - --regex-Rust=/^[ \t]*(pub[ \t]+)?enum[ \t]+([a-zA-Z0-9_]+)/\2/g,enum,enumeration names/ - --regex-Rust=/^[ \t]*(pub[ \t]+)?struct[ \t]+([a-zA-Z0-9_]+)/\2/s,structure names/ - --regex-Rust=/^[ \t]*(pub[ \t]+)?mod[ \t]+([a-zA-Z0-9_]+)/\2/m,modules,module names/ - --regex-Rust=/^[ \t]*(pub[ \t]+)?(static|const)[ \t]+(mut[ \t]+)?([a-zA-Z0-9_]+)/\4/c,consts,static constants/ - --regex-Rust=/^[ \t]*(pub[ \t]+)?(unsafe[ \t]+)?trait[ \t]+([a-zA-Z0-9_]+)/\3/t,traits,traits/ - --regex-Rust=/^[ \t]*(pub[ \t]+)?(unsafe[ \t]+)?impl([ \t\n]*<[^>]*>)?[ \t]+(([a-zA-Z0-9_:]+)[ \t]*(<[^>]*>)?[ \t]+(for)[ \t]+)?([a-zA-Z0-9_]+)/\5 \7 \8/i,impls,trait implementations/ - --regex-Rust=/^[ \t]*macro_rules![ \t]+([a-zA-Z0-9_]+)/\1/d,macros,macro definitions/ - - - -Plugins ------------- - -* [Solarized](https://github.com/altercation/vim-colors-solarized) - color - scheme -* [base16-vim](https://github.com/chriskempson/base16-vim) - color scheme -* [vim-molokai](https://github.com/tomasr/molokai) - color scheme -* [Oceanic-next](https://github.com/mhartington/oceanic-next) - color scheme -* [Nord VIM](https://github.com/arcticicestudio/nord-vim) - color scheme -* [Gruvbox](https://github.com/morhetz/gruvbox) - color scheme -* [Fugitive](https://github.com/tpope/vim-fugitive) - a Git wrapper so awesome, - it should be illegal -* [gv.vim](https://github.com/junegunn/gv.vim) - A git commit browser in Vim -* [Lawrencium](https://github.com/ludovicchabant/vim-lawrencium) - Mercurial - wrapper for Vim, inspired by Tim Pope's Fugitive -* [ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim) - Fuzzy file, buffer, mru, - tag, etc finder -* [ale](https://github.com/w0rp/ale) - Asynchronous Lint Engine -* [coc.nvim](https://github.com/neoclide/coc.nvim) - Intellisense engine for - vim8 & neovim, full language server protocol support as VSCode -* [UltiSnips](https://github.com/sirver/ultisnips) - The ultimate snippet - solution for Vim. -* [vim-snippets](https://github.com/honza/vim-snippets) - vim-snipmate default - snippets -* [python-mode](https://github.com/klen/python-mode) - Vim python-mode. PyLint, - Rope, Pydoc, breakpoints from box -* [vim-go](https://github.com/fatih/vim-go) - Go development plugin for Vim -* [rust.vim](https://github.com/rust-lang/rust.vim) - provides Rust file - detection, syntax highlighting, formatting, Syntastic integration, and more. -* [DrawIt](https://github.com/vim-scripts/DrawIt) - ASCII drawing plugin: - lines, ellipses, arrows, fills, and more! -* [vim-surround](https://github.com/tpope/vim-surround) - - quoting/parenthesizing made simple -* [Shebang](https://github.com/vim-scripts/Shebang) - Make executable by - setting the correct shebang and executable bit -* [Tagbar](http://majutsushi.github.com/tagbar/) - Displays tags in a window, - ordered by class etc. -* [NERD tree](https://github.com/scrooloose/nerdtree) - A tree explorer -* [nerdtree-git-plugin](https://github.com/Xuyuanp/nerdtree-git-plugin) - A - plugin of NERDTree showing git status -* [auto-pairs](https://github.com/jiangmiao/auto-pairs) - Insert or delete - brackets, parens, quotes in pair -* [po.vim](http://vim.sourceforge.net/scripts/script.php?script_id=695) - - Easier editing of GNU gettext PO files -* [MatchTagAlways](https://github.com/valloric/MatchTagAlways) - A Vim plugin - that always highlights the enclosing html/xml tags -* [vim-airline](https://github.com/bling/vim-airline) - Light weight status - line utility -* [tabular](https://github.com/godlygeek/tabular) - text filtering and - alignment -* [tcomment_vim](https://github.com/tomtom/tcomment_vim) - An extensible & - universal comment vim-plugin that also handles embedded filetypes -* [vim-unimpaired](https://github.com/tpope/vim-unimpaired) - pairs of handy - bracket mappings -* [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors) - - True Sublime Text style multiple selections for Vim -* [splitjoin.vim](https://github.com/AndrewRadev/splitjoin.vim) - A Vim plugin - that simplifies the transition between multiline and single-line code -* [vim-repeat](https://github.com/tpope/vim-repeat) - enable repeating supported plugin maps with "." -* [tsuquyomi](https://github.com/Quramy/tsuquyomi) - A Vim plugin for TypeScript -* [vim-highlightedyank](https://github.com/machakann/vim-highlightedyank) - Make the yanked region apparent! - - -Shortcuts and re-Mappings ----------------------------- - -| Key | Command | -| ---------------------- | ----------------------------------------------------------------- | -| ``jj`` | ```` in insert and command modes | -| ```` | ```` | -| ``v`` | Load `.vimrc` | -| ``V`` | Activate changes to `.vimrc` (Make sure to save it before) | -| ```` | Close current split (window) | -| ```` | Toggle NERD tree | -| ```` | Toggle Tagbar | -| ``S`` | Remove trailing whitespace | -| ``hjkl`` | Window movement commands | -| ``arrow`` | Window movement commands | -| ``d`` | Delete buffer, keep the split | -| ``-``, ``+`` | Resize horizontal splits | -| ``<`` ``>`` | Resize vertical splits | -| ```` | Toggle logical (RTL, e.g: Hebrew) editing | -| ```` | Toggle visual (RTL, e.g: Hebrew) editing | -| ``g/`` | :grep! | -| ``g*`` | :grep! -w current_word | -| ``ga`` | :grepadd! (add results to the current search) | -| ``gr`` | :CtrlPBufTag (fuzzy tag search in current file) | - - -Virtualenv settings -------------------- - -If you're running from virtualenv activated, make sure to point nvim and ale to -correct locations. By default, settings are: - - let g:python3_host_prog = '/usr/bin/python' - let g:ale_python_flake8_executable = '/usr/bin/flake8' - -If needed, override those settings to the locations on your machine. diff --git a/vim/.vim/UltiSnips/go_perso.snippets b/vim/.vim/UltiSnips/go_perso.snippets deleted file mode 100644 index fd2b07b..0000000 --- a/vim/.vim/UltiSnips/go_perso.snippets +++ /dev/null @@ -1,126 +0,0 @@ -# functions test -snippet /^test/ "Main function" r -func Test_${1:Func}(t *testing.T) { - ${0:${VISUAL}} -} -endsnippet - -snippet tt "table-driven tests" -func Test_${1:Func}(t *testing.T) { - testCases := []struct { - name string - expected ${2} - ${3} - }{ - { - name: "happy case", - expected: ${4}, - ${5}, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - actual := ${7}$1(${6:params}) - - if $8 { - t.Errorf("Expected %v, actual %v", tc.expected, actual) - } - }) - } -} -endsnippet - -snippet tte "table-driven tests with errors" -func Test_${1:Func}(t *testing.T) { - testCases := []struct { - name string - expected ${2} - ${3} - wantErr bool - }{ - { - name: "happy case", - expected: ${4} - ${5}, - wantErr: false, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - actual, err := ${7}$1(${6:params}) - if (err != nil) != tc.wantErr { - t.Errorf("Error '%v' even if wantErr is %t", err, tc.wantErr) - return - } - - if tc.wantErr == false && $8 { - t.Errorf("Expected %v, actual %v", tc.expected, actual) - } - }) - } -} -endsnippet - -snippet err "Basic error handling" b -if err != nil { - ${1} -} -endsnippet - -snippet errr "Basic error handling return err" b -if err != nil { - return err -} -${1} -endsnippet - -snippet errr, "Basic error handling return err with another return" b -if err != nil { - return ${1:nil}, err -} -endsnippet - -snippet errw "Return wrapped error" b -if err != nil { - return errors.Wrap(err, "${1}") -} -endsnippet - -snippet errwf "Basic error handling with wrapping format" b -if err != nil { - return errors.Wrapf(err, "${1}", ${2}) -} -endsnippet - -snippet errab "Basic abort with error from Gin Context" b -if err != nil { - _ = c.AbortWithError(http.StatusInternalServerError, err) - return -} -endsnippet - -snippet errabwf "Basic abort with error from Gin Context" b -if err != nil { - err = errors.Wrapf(err, "${1}", ${2}) - c.AbortWithError(http.StatusInternalServerError, err) - return -} -endsnippet - -snippet /^package/ "Package declaration" b -// Package $1 provides ... -package ${1:main} -$2 -endsnippet - -snippet switcht "Switch type statement" b -switch ${1:expression}${1/(.+)/ /} := ${2:var}.(Type) { -case ${0:int} -} -endsnippet - -snippet e: "Variable declaration := with error" b -${1:name}, err:= ${0:value} -endsnippet diff --git a/vim/.vim/UltiSnips/javascript_perso.snippets b/vim/.vim/UltiSnips/javascript_perso.snippets deleted file mode 100644 index a6c4004..0000000 --- a/vim/.vim/UltiSnips/javascript_perso.snippets +++ /dev/null @@ -1,11 +0,0 @@ -snippet faf "Fat arrow function (faf)" w -${1:function_name} = (${2:argument}) => { - ${VISUAL}$0 -} -endsnippet - -snippet afaf "Anonymous fat arrow function (faf)" w -(${1:argument}) => { - ${VISUAL}$0 -} -endsnippet diff --git a/vim/.vim/UltiSnips/php_perso.snippets b/vim/.vim/UltiSnips/php_perso.snippets deleted file mode 100644 index 19d5895..0000000 --- a/vim/.vim/UltiSnips/php_perso.snippets +++ /dev/null @@ -1,154 +0,0 @@ -snippet ns "namespace declaration" b -namespace ${1:`!p -abspath = os.path.abspath(path) -m = re.search(r'[A-Z].+(?=/)', abspath) -if m: - snip.rv = m.group().replace('/', '\\') -`}; -endsnippet - -snippet class "Class declaration template with strict mode" b -addSql(" - $0 -"); -endsnippet - -snippet classst "Symlex test class declaration" b - Settings (01-settings) -" -> Theme (02-theme) -" -> Keymap (10-keymap-general, 11-keymap-rtl) -" -> File type specific (31-file-type.vim) -" -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - diff --git a/vim/.vim/install.sh b/vim/.vim/install.sh deleted file mode 100755 index 6974072..0000000 --- a/vim/.vim/install.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -set -e - -# Install nvim -sudo apt remove vim-tiny -sudo apt install -y vim fzf silversearcher-ag tmux zathura latexmk git curl - -# Install ctags (for tagbar) -echo '[*] App installing dependencies for tagbar (exuberant-ctags) ...' -sudo apt update -sudo apt install -y exuberant-ctags global - - -# Install vim-plug plugin manager -echo '[*] Downloading vim-plug, the best minimalistic vim plugin manager ...' -curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - -# (Optional but recommended) Install a nerd font for icons and a beautiful lightline bar (https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts) -echo "[*] Downloading patch font into ~/.local/share/fonts ..." -curl -fLo ~/.local/share/fonts/Iosevka\ Term\ Nerd\ Font\ Complete.ttf --create-dirs https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Iosevka/Regular/complete/Iosevka%20Term%20Nerd%20Font%20Complete.ttf - -# Enter vim and install plugins using a temporary init.vim, which avoids warnings about missing colorschemes, functions, etc -echo '[*] Running :PlugInstall within nvim ...' -vim +PlugInstall +qa - -echo "[+] Done, welcome to \\033[1m\\033[92mVim\\033[0m! Try it by running: vim." diff --git a/vim/.vim/make_basic.sh b/vim/.vim/make_basic.sh deleted file mode 100755 index b2398ec..0000000 --- a/vim/.vim/make_basic.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/zsh -cat basic_header.vim rc.d/{01-settings,02-theme,10-keymap-general,11-keymap-rtl,31-file-type}.vim > basic.vim -sed -i 's/colorscheme minimalist/colorscheme desert/g' basic.vim diff --git a/vim/.vim/rc.d/00-plugins.vim b/vim/.vim/rc.d/00-plugins.vim index 74706cb..33805ab 100644 --- a/vim/.vim/rc.d/00-plugins.vim +++ b/vim/.vim/rc.d/00-plugins.vim @@ -2,15 +2,10 @@ " vim-plug setup " ================================================== " -call plug#begin('~/.local/share/nvim/plugged') +call plug#begin('~/.local/share/vim/plugged') " Color schemes and appearance - -Plug 'frankier/neovim-colors-solarized-truecolor-only' -Plug 'chriskempson/base16-vim' -Plug 'drewtempelmeyer/palenight.vim' -"Plug 'kaicataldo/material.vim' -Plug 'dikiaap/minimalist' +Plug 'folke/tokyonight.nvim' " Appearance Plug 'ryanoasis/vim-devicons' @@ -19,57 +14,30 @@ Plug 'junegunn/limelight.vim' Plug 'junegunn/goyo.vim' Plug 'nathanaelkane/vim-indent-guides' Plug 'junegunn/vim-journal' -Plug 'luochen1990/rainbow' Plug 'bling/vim-bufferline' -" easy way to rezise and exchange windows -Plug 'simeji/winresizer' - " General utilities - +Plug 'simeji/winresizer' " easy way to rezise and exchange windows Plug 'ctrlpvim/ctrlp.vim' -Plug 'farmergreg/vim-lastplace' Plug 'tpope/vim-sensible' Plug 'tpope/vim-surround' Plug 'scrooloose/nerdtree', { 'on': ['NERDTreeToggle', 'NERDTreeFind']} Plug 'tiagofumo/vim-nerdtree-syntax-highlight' Plug 'jistr/vim-nerdtree-tabs' Plug 'ervandew/supertab' -Plug 'vim-scripts/DrawIt' -Plug 'terryma/vim-multiple-cursors' Plug 'machakann/vim-highlightedyank' -Plug 'tpope/vim-repeat' -Plug 'junegunn/vim-easy-align' Plug 'tpope/vim-abolish' Plug 'Yggdroot/indentLine' Plug 'chrisbra/Colorizer' -Plug 'heavenshell/vim-pydocstring' -Plug 'vim-scripts/loremipsum' -Plug 'metakirby5/codi.vim' -Plug 'dkarter/bullets.vim' -Plug 'wesQ3/vim-windowswap' -Plug 'benmills/vimux' -Plug 'schickling/vim-bufonly' -Plug 'shougo/echodoc.vim' -Plug 'tpope/vim-sleuth' -"Plug 'tpope/vim-unimpaired' -Plug 'shougo/denite.nvim' -Plug 'wincent/loupe' -Plug 'jez/vim-superman' " Open man with vim using vman (need to be configured in zsh boot) Plug 'blueyed/vim-diminactive' " Plug to dim not-focused windows Plug 'lambdalisue/suda.vim' " Write file with sudo Plug 'junegunn/vim-peekaboo' " Display register values on " and @ -Plug 'yangmillstheory/vim-snipe' " replace f F t T to target easily the motion - -" undo tree -Plug 'simnalamburt/vim-mundo' -" close the current buffer -Plug 'moll/vim-bbye' +"Plug 'yangmillstheory/vim-snipe' " replace f F t T to target easily the motion +Plug 'simnalamburt/vim-mundo' " undo tree " Version control support -" Plug 'tpope/vim-fugitive' Plug 'mhinz/vim-signify' Plug 'Xuyuanp/nerdtree-git-plugin' @@ -82,8 +50,6 @@ Plug 'majutsushi/tagbar' Plug 'liuchengxu/vista.vim' Plug 'editorconfig/editorconfig-vim' Plug 'vim-scripts/Shebang' -Plug 'sirver/ultisnips' -Plug 'honza/vim-snippets' Plug 'Valloric/MatchTagAlways' Plug 'amiorin/vim-project' Plug 'mhinz/vim-startify' @@ -94,7 +60,6 @@ Plug 'ludovicchabant/vim-gutentags' Plug 'skywind3000/gutentags_plus' Plug 'skywind3000/vim-preview' - " fzf - poweful fuzzy finder " Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } " Plug 'junegunn/fzf.vim' @@ -113,8 +78,8 @@ Plug 'hail2u/vim-css3-syntax' Plug 'cakebaker/scss-syntax.vim' Plug 'vim-scripts/Fold-license' Plug 'neomake/neomake' -Plug 'joonty/vdebug' Plug 'ap/vim-css-color' " display the hexadecimal colors - useful for css and color config +Plug 'tpope/vim-sleuth' " Polyglot Plug 'sheerun/vim-polyglot' @@ -158,9 +123,7 @@ Plug 'vim-scripts/svg.vim' Plug 'voldikss/vim-mma' Plug 'wgwoods/vim-systemd-syntax' Plug 'wlangstroth/vim-racket' - -" emmet for html -Plug 'mattn/emmet-vim' +Plug 'mattn/emmet-vim' " emmet for html " Markdown / Writting Plug 'reedes/vim-pencil' @@ -217,7 +180,14 @@ Plug 'mxw/vim-jsx' " Smart Autocomplete Plug 'w0rp/ale' Plug 'kristijanhusak/deoplete-phpactor' -Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } +if has('nvim') + Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } +else + Plug 'Shougo/deoplete.nvim' + Plug 'roxma/nvim-yarp' + Plug 'roxma/vim-hug-neovim-rpc' +endif +let g:deoplete#enable_at_startup = 1 Plug 'zchee/deoplete-clang' Plug 'wokalski/autocomplete-flow' Plug 'sebastianmarkow/deoplete-rust' @@ -229,6 +199,11 @@ Plug 'othree/xml.vim' Plug 'c9s/perlomni.vim' Plug 'artur-shaik/vim-javacomplete2' +" Snippets +Plug 'SirVer/ultisnips' +Plug 'honza/vim-snippets' +let g:UltiSnipsSnippetDirectories=[$HOME.'/.vim/UltiSnips'] + call plug#end() " vim:set et sw=2: diff --git a/vim/.vim/rc.d/01-settings.vim b/vim/.vim/rc.d/01-settings.vim index ee9a2ca..fe6293d 100644 --- a/vim/.vim/rc.d/01-settings.vim +++ b/vim/.vim/rc.d/01-settings.vim @@ -63,10 +63,10 @@ set tw=80 " Turn persistent undo on means that you can undo " even when you close a buffer/VIM " ================================================== -set directory=~/.nvim_runtime/temp_dirs/swap/ -set backupdir=~/.nvim_runtime/temp_dirs/backup/ +set directory=~/.vim_runtime/temp_dirs/swap/ +set backupdir=~/.vim_runtime/temp_dirs/backup/ try - set undodir=~/.nvim_runtime/temp_dirs/undodir + set undodir=~/.vim_runtime/temp_dirs/undodir set undofile catch endtry diff --git a/vim/.vim/rc.d/02-theme.vim b/vim/.vim/rc.d/02-theme.vim index be5fed2..ef5e826 100644 --- a/vim/.vim/rc.d/02-theme.vim +++ b/vim/.vim/rc.d/02-theme.vim @@ -1,8 +1,8 @@ " ================================================== " Color scheme and fonts " ================================================== -let g:rainbow_active = 1 "set to 0 if you want to enable it later via :RainbowToggle -let g:material_theme_style = 'palenight' + +colorscheme tokyonight-storm " disable the mouse - who needs a mouse?? set mouse-=a @@ -38,12 +38,8 @@ if $COLORTERM == 'gnome-terminal' endif set background=dark -"colorscheme material set t_Co=256 -colorscheme minimalist hi Conceal guifg=#81A1C1 guibg=NONE ctermbg=NONE -let g:palenight_terminal_italics=1 -let g:material_terminal_italics = 1 "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 > "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd > @@ -66,7 +62,7 @@ highlight Comment gui=bold highlight Normal gui=NONE highlight NonText guibg=NONE -" Transparent Background (For i3 and compton) +" Transparent Background (For i3 and picom) highlight Normal guibg=NONE ctermbg=NONE highlight LineNr guibg=NONE ctermbg=NONE diff --git a/vim/.vim/rc.d/10-keymap-general.vim b/vim/.vim/rc.d/10-keymap-general.vim index 63ab649..566b496 100644 --- a/vim/.vim/rc.d/10-keymap-general.vim +++ b/vim/.vim/rc.d/10-keymap-general.vim @@ -22,11 +22,6 @@ nnoremap k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk' nnoremap n nzz nnoremap N Nzz -" Save session -exec 'nnoremap ss :mksession! ~/.nvim_runtime/sessions/*.vim' -" Reload session -exec 'nnoremap sl :so ~/.nvim_runtime/sessions/*.vim' - " quick make map :make @@ -34,13 +29,8 @@ map :make " http://tilvim.com/2014/03/18/a-better-paste.html map p :set pasteo"+]p:set nopaste -" Quickly save, quit, or save-and-quit -map w :w -map x :x -map q :q - " un-highlight when esc is pressed -map :noh +"map :noh " Quickly toggle relative line numbers @@ -62,8 +52,8 @@ cnoremap w!! execute ':w suda://%' " ,v loads .vimrc " ,V reloads .vimrc -- activating changes (needs save) -map v :sp ~/.config/nvim/init.vim_ -map V :source ~/.config/nvim/init.vim:filetype detect:exe ":echo 'vimrc reloaded'" +"map v :sp ~/.config/nvim/init.vim_ +"map V :source ~/.config/nvim/init.vim:filetype detect:exe ":echo 'vimrc reloaded'" " ================================================== " Window navigation @@ -88,7 +78,7 @@ nnoremap wcc :cclose " windows creation " create window on the bottom nnoremap wb s -" create vertival window +" create vertical window nnoremap wv v " " arrow keys resize windows @@ -106,7 +96,7 @@ nnoremap wv v " ================================================== " Make these all work in insert mode -imap +"imap " - and + to resize horizontal splits map - - @@ -142,11 +132,6 @@ nnoremap tL :tabm noremap gt noremap gT -" Let 'tl' toggle between this and the last accessed tab -let g:lasttab = 1 -nmap 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 map te :tabedit =expand("%:p:h")/ @@ -170,7 +155,6 @@ nmap :bprevious " ================================================== " Clean all end of line whitespace with S " ================================================== -":nnoremap S :let _s=@/:%s/\s\+$//e:let @/=_s:nohl fun! TrimWhitespace() let l:save = winsaveview() keeppatterns %s/\s\+$//e @@ -178,51 +162,6 @@ fun! TrimWhitespace() endfun :nnoremap S :call TrimWhitespace() -" ================================================== -" Visual mode related -" ================================================== -" Visual mode pressing * or # searches for the current selection -" Super useful! From an idea by Michael Naumann -vnoremap * :call VisualSelection('', '')/=@/ -vnoremap # :call VisualSelection('', '')?=@/ - -function! VisualSelection(direction, extra_filter) range - let l:saved_reg = @" - execute "normal! vgvy" - - let l:pattern = escape(@", "\\/.*'$^~[]") - let l:pattern = substitute(l:pattern, "\n$", "", "") - - if a:direction == 'gv' - call CmdLine("Ack '" . l:pattern . "' " ) - elseif a:direction == 'replace' - call CmdLine("%s" . '/'. l:pattern . '/') - endif - - let @/ = l:pattern - let @" = l:saved_reg -endfunction - - -" ================================================== -" Editing mappings -" ================================================== -" Remap VIM 0 to first non-blank character -map 0 ^ - -" Move a line of text using ALT+[jk] or Command+[jk] on mac -nmap mz:m+`z -nmap mz:m-2`z -vmap :m'>+`mzgv`yo`z -vmap :m'<-2`>my` - nmap - vmap - vmap -endif - " ================================================== " Spell checking " ================================================== @@ -239,9 +178,6 @@ map s? z= " Other Configurations " ================================================== -" Remove the Windows ^M - when the encodings gets messed up -noremap m mmHmt:%s///ge'tzt'm - " Quickly open a buffer for scribble map q :e ~/buffer @@ -251,25 +187,6 @@ map x :e ~/buffer.md " Toggle paste mode on and off map pp :setlocal paste! -noremap :Denite buffer file_rec tag - -xmap a gaip* -nmap t sj:terminal -nmap vt vl:terminal -nmap g :Goyo -nmap j :set filetype=journal -nmap l :Limelight!! -autocmd FileType python nmap x :0,$!~/.config/nvim/env/bin/python -m yapf - -vmap !boxes -d stone - -" surround by quotes - frequently use cases of vim-surround -map " ysiw" -map ' ysiw' - -" Act like D and C -nnoremap Y y$ - " indent without kill the selection in vmode vmap < >gv @@ -283,11 +200,6 @@ nnoremap [ :%s///g " Change in next bracket nmap cinb cib -" Visual mode pressing * or # searches for the current selection -" Super useful! From an idea by Michael Naumann -vnoremap * :call general#VisualSelection('', '')/=@/ -vnoremap # :call general#VisualSelection('', '')?=@/ - " delete character after cursor in insert mode inoremap @@ -317,10 +229,4 @@ let g:cm_matcher={'module': 'cm_matchers.abbrev_matcher', 'case': 'smartcase'} " Disable anoying ex mode nnoremap Q -" Neovim :Terminal -tmap -tmap -autocmd BufWinEnter,WinEnter term://* startinsert -autocmd BufLeave term://* stopinsert - " vim:set et sw=2: diff --git a/vim/.vim/rc.d/11-keymap-rtl.vim b/vim/.vim/rc.d/11-keymap-rtl.vim index a16b4b3..4e88578 100644 --- a/vim/.vim/rc.d/11-keymap-rtl.vim +++ b/vim/.vim/rc.d/11-keymap-rtl.vim @@ -4,14 +4,14 @@ " toggle direction mapping " this is useful for logical-order editing -map :set invrl +"map :set invrl " do it when in insert mode as well (and return to insert mode) -imap :set invrla +"imap :set invrla " toggle reverse insertion " this is useful for visual-order editing -map :set invrevins +"map :set invrevins " do it when in insert mode as well (and return to insert mode) -imap :set invrevinsa +"imap :set invrevinsa " vim:set et sw=2: diff --git a/vim/.vim/rc.d/20-lightline.vim b/vim/.vim/rc.d/20-lightline.vim index 3d22d48..95ea81f 100644 --- a/vim/.vim/rc.d/20-lightline.vim +++ b/vim/.vim/rc.d/20-lightline.vim @@ -1,7 +1,7 @@ " ================================================== " lightline " ================================================== -let g:lightline = { 'colorscheme': 'material_vim' } +let g:lightline = { 'colorscheme': 'tokyonight' } let g:lightline.active = { \ 'left': [ [ 'mode', 'paste' ], [ 'readonly', 'filename','gitbranch', 'modified', 'neospinner'] ], @@ -11,6 +11,5 @@ let g:lightline.component = { \ 'charvaluehex': '0x%B', \ 'readonly': '%{&readonly?"⭤":""}' \ } -let g:lightline.colorscheme = 'palenight' " vim:set et sw=2: diff --git a/vim/.vim/rc.d/20-vdebug.vim b/vim/.vim/rc.d/20-vdebug.vim index 58fda95..8877c43 100644 --- a/vim/.vim/rc.d/20-vdebug.vim +++ b/vim/.vim/rc.d/20-vdebug.vim @@ -22,8 +22,5 @@ let g:vdebug_keymap = { let g:vdebug_options["path_maps"] = { \} -" redefine the characters -autocmd VimEnter * sign define breakpt text= texthl=DbgBreakptSign linehl=DbgBreakptLine -autocmd VimEnter * sign define current text= texthl=DbgCurrentSign linehl=DbgCurrentLine " vim:set et sw=2: diff --git a/vim/.vim/rc.d/20-vimtex.vim b/vim/.vim/rc.d/20-vimtex.vim new file mode 100644 index 0000000..f6f26d0 --- /dev/null +++ b/vim/.vim/rc.d/20-vimtex.vim @@ -0,0 +1,10 @@ +let g:vimtex_view_method = 'zathura' +let g:vimtex_compiler_progname = '.venv/bin/nvr' +let g:tex_flavor = 'latex' +let g:ale_linters_ignore = { + \ 'tex': ['lacheck'], + \} +let g:ale_tex_chktex_options = "-I --nowarn 18" +augroup vimtex_config + autocmd User VimtexEventInitPost VimtexCompile +augroup END