├── .vimrc └── README.md /.vimrc: -------------------------------------------------------------------------------- 1 | 2 | " ██ ██ ██ ███ ███ ██████ ██████ 3 | " ██ ██ ██ ████ ████ ██ ██ ██ 4 | " ██ ██ ██ ██ ████ ██ ██████ ██ 5 | " ██ ██ ██ ██ ██ ██ ██ ██ ██ 6 | "██ ████ ██ ██ ██ ██ ██ ██████ 7 | 8 | "Author: Sergio Rodriguez 9 | " 10 | "This configuration file comes with ABSOLUTELY NO WARRANTY, 11 | "to the extent permitted by applicable law. 12 | 13 | 14 | "---------GENERAL SETTINGS------------ 15 | 16 | "Set compatibility to Vim only. 17 | set nocompatible 18 | set nolist 19 | set rnu 20 | 21 | "Helps force plug-ins to load correctly when it is turned back on below. 22 | filetype on 23 | 24 | " Turn on syntax highlighting. 25 | syntax on 26 | 27 | " For plug-ins to load correctly. 28 | filetype plugin indent on 29 | 30 | " Turn off modelines 31 | set modelines=0 32 | 33 | " Automatically wrap text that extends beyond the screen length. 34 | set wrap 35 | 36 | " Uncomment below to set the max textwidth. Use a value corresponding to the width of your screen. 37 | set textwidth=79 38 | set formatoptions=tcqrn1 39 | set tabstop=2 40 | set shiftwidth=2 41 | set softtabstop=2 42 | set expandtab 43 | set noshiftround 44 | 45 | " Display 5 lines above/below the cursor when scrolling with a mouse. 46 | set scrolloff=5 47 | 48 | " Fixes common backspace problems 49 | set backspace=indent,eol,start 50 | 51 | " Speed up scrolling in Vim 52 | set ttyfast 53 | 54 | " Status bar 55 | set laststatus=2 56 | 57 | " Display options 58 | set showmode 59 | set showcmd 60 | 61 | " Highlight matching pairs of brackets. Use the '%' character to jump between them. 62 | set matchpairs+=<:> 63 | 64 | " Show line numbers 65 | set number 66 | 67 | " Set status line display 68 | set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ [BUFFER=%n]\ %{strftime('%c')} 69 | 70 | " Encoding 71 | set encoding=utf-8 72 | 73 | " Highlight matching search patterns 74 | set hlsearch 75 | 76 | " Enable incremental search 77 | set incsearch 78 | 79 | " Include matching uppercase words with lowercase search term 80 | set ignorecase 81 | 82 | " Include only uppercase words with uppercase search term 83 | set smartcase 84 | 85 | " Store info from no more than 100 files at a time, 9999 lines of text, 100kb of data. Useful for copying large amounts of data between files. 86 | set viminfo='100,<9999,s100 87 | 88 | 89 | " ---------------PLUGINS-------------------- 90 | " 91 | "Plugin autoinstalling 92 | if empty(glob('~/.vim/autoload/plug.vim')) 93 | silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs 94 | \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 95 | autocmd VimEnter * PlugInstall --sync | source $MYVIMRC 96 | endif 97 | 98 | call plug#begin('~/.vim/plugged') 99 | 100 | "Syntax highlighting and autocompletion 101 | Plug 'neoclide/coc.nvim' , { 'branch' : 'release' } 102 | Plug 'sheerun/vim-polyglot' 103 | Plug 'pangloss/vim-javascript' 104 | Plug 'leafgarland/typescript-vim' 105 | Plug 'jiangmiao/auto-pairs' 106 | Plug 'alvan/vim-closetag' 107 | 108 | "File search and navigation 109 | Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } 110 | Plug 'junegunn/fzf.vim' 111 | Plug 'preservim/nerdtree' 112 | 113 | "Editor interface and theming 114 | Plug 'morhetz/gruvbox' 115 | Plug 'vim-airline/vim-airline' 116 | Plug 'ryanoasis/vim-devicons' 117 | Plug 'yggdroot/indentline' 118 | Plug 'tiagofumo/vim-nerdtree-syntax-highlight' 119 | 120 | "Debugging, refactoring and version control 121 | Plug 'puremourning/vimspector' 122 | 123 | call plug#end() 124 | 125 | "---------- PLUGIN VARIABLES--------------- 126 | " 127 | let g:airline_powerline_fonts = 1 128 | let g:coc_global_extensions = [ 'coc-tsserver' ] 129 | autocmd VimEnter * NERDTree | wincmd p 130 | " Exit Vim if NERDTree is the only window remaining in the only tab. 131 | autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif 132 | colorscheme gruvbox 133 | set bg=dark 134 | 135 | "-----------NAVIGATION KEYMAPS------------- 136 | " 137 | " GoTo code navigation. 138 | nmap gd (coc-definition) 139 | nmap gy (coc-type-definition) 140 | nmap gi (coc-implementation) 141 | nmap gr (coc-references) 142 | 143 | " Move 1 more lines up or down in normal and visual selection modes. 144 | vnoremap J :m '>+1gv=gv 145 | nnoremap K :m .-2== 146 | nnoremap J :m .+1== 147 | vnoremap K :m '<-2gv=gv 148 | 149 | "Misc 150 | :imap ii 151 | 152 | " Map the key to toggle a selected fold opened/closed. 153 | nnoremap @=(foldlevel('.')?'za':"\") 154 | vnoremap zf 155 | 156 | "Autosave folds 157 | autocmd BufWinLeave *.* mkview 158 | autocmd BufWinEnter *.* silent loadview 159 | 160 | "Search shortcuts 161 | let mapleader = "," 162 | noremap w :w 163 | noremap gs :CocSearch 164 | noremap fs :Files 165 | noremap h:q 166 | 167 | " Vim's auto indentation feature does not work properly with text copied from outside of Vim. Press the key to toggle paste mode on/off. 168 | nnoremap :set invpaste paste? 169 | imap :set invpaste paste? 170 | set pastetoggle= 171 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vim-ide 2 | 3 | This vim configuration file is a compilation of plugins and settings oriented to achieving a workflow close to an IDE, in order to take advantage of its lightweight nature. 4 | 5 | ## Dependencies. 6 | 7 | 1.[`nodejs`](nodejs.org), required by [`junegunn/vim-plug`](https://github.com/junegunn/vim-plug) 8 | 9 | 2.[`code-minimap`](https://github.com/wfxr/code-minimap), required by [`wfxr/minimap.vim`](https://github.com/wfxr/minimap.vim) 10 | 11 | ## Installing. 12 | 13 | 1. Make a backup of your current `vim` settings. 14 | 15 | 2. Place this file on your `$HOME` directory. 16 | 17 | 3. Launch `vim`. 18 | 19 | This will install all plugins via `vim-plug`, also setting variables and keymaps for such plugins. 20 | --------------------------------------------------------------------------------