diff options
| author | Max Christian Pohle | 2018-01-19 23:55:47 +0100 |
|---|---|---|
| committer | Max Christian Pohle | 2018-01-19 23:55:47 +0100 |
| commit | 7eea1b6c9c6f807fe53ff896a88a14171334c690 (patch) | |
| tree | 616f0b2c0432b6bea14b7104d53726f93ae422c8 /vimrc-full | |
| parent | 989a349f9a5da58f5b158c448c93e6a6005cb867 (diff) | |
| download | vim-karlmarks-7eea1b6c9c6f807fe53ff896a88a14171334c690.tar.bz2 vim-karlmarks-7eea1b6c9c6f807fe53ff896a88a14171334c690.zip | |
Added spell checking capabilities
Diffstat (limited to 'vimrc-full')
| -rw-r--r-- | vimrc-full | 67 |
1 files changed, 35 insertions, 32 deletions
| @@ -7,8 +7,8 @@ set exrc | " enable exrc, a specific .exrc per project, | |||
| 7 | set textwidth=120 | " better done with modeline or local exrc | 7 | set textwidth=120 | " better done with modeline or local exrc |
| 8 | set ts=4 sts=4 sw=4 expandtab | " better done with a modeline or local exrc | 8 | set ts=4 sts=4 sw=4 expandtab | " better done with a modeline or local exrc |
| 9 | set virtualedit=all | " virtual edit should be default behaviour, because I don't see any reason against | 9 | set virtualedit=all | " virtual edit should be default behaviour, because I don't see any reason against |
| 10 | set nonumber norelativenumber | " do not show numbers by default, because that causes a performance loss, instead activate them on a filetype basis | 10 | set nonumber norelativenumber | " do not show numbers by default, because that causes a performance loss, instead activate them on a file type basis |
| 11 | set ignorecase smartcase hlsearch | " search with ignorecase by default, but use case sensitive search when one captical char is contained and highlight while typing (even though its slower) | 11 | set ignorecase smartcase hlsearch | " search with ignore case by default, but use case sensitive search when one capital char is contained and highlight while typing (even though its slower) |
| 12 | 12 | ||
| 13 | "======================================================================================================================= | 13 | "======================================================================================================================= |
| 14 | " SHELL | 14 | " SHELL |
| @@ -24,26 +24,26 @@ endif | |||
| 24 | "======================================================================================================================= | 24 | "======================================================================================================================= |
| 25 | if has('persistent_undo') | 25 | if has('persistent_undo') |
| 26 | if isdirectory('/dev/shm') | 26 | if isdirectory('/dev/shm') |
| 27 | set undodir=/dev/shm/ | " save undo file in memory. That is volatile, but fast and we have GIT for longer lasting undos | 27 | set undodir=/dev/shm/ | " save undo file in memory. That is volatile, but fast and we have GIT for longer lasting undoes |
| 28 | set directory=/dev/shm/ | " swap file directory to RAM | 28 | set directory=/dev/shm/ | " swap file directory to RAM |
| 29 | set swapfile | 29 | set swapfile |
| 30 | elseif isdirectory('/tmp/') | 30 | elseif isdirectory('/tmp/') |
| 31 | set undodir=/tmp/ | 31 | set undodir=/tmp/ |
| 32 | endif | 32 | endif |
| 33 | set undofile | " preserve undo history when closing and reopening buffers (see :help undo-persistenece) | 33 | set undofile | " preserve undo history when closing and reopening buffers (see :help undo-persistence) |
| 34 | endif | 34 | endif |
| 35 | 35 | ||
| 36 | "======================================================================================================================= | 36 | "======================================================================================================================= |
| 37 | " multi byte | 37 | " multi byte |
| 38 | "======================================================================================================================= | 38 | "======================================================================================================================= |
| 39 | if has("multi_byte") | 39 | if has("multi_byte") |
| 40 | scriptencoding utf-8 | " tell vim that we are using utf-8 here | 40 | scriptencoding utf-8 | " tell vim that we are using UTF-8 here |
| 41 | set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) | 41 | set encoding=utf-8 | " we need default UTF-8 encoding to use cool chars as line break and so on (see below) |
| 42 | let &termencoding=&encoding | " once we use special chars we assume everybody uses a terminal supporting those | 42 | let &termencoding=&encoding | " once we use special chars we assume everybody uses a terminal supporting those |
| 43 | 43 | ||
| 44 | set fillchars+=fold:\— | " | 44 | set fillchars+=fold:\— | " |
| 45 | set fillchars+=vert:\║ | " cool vertical split char | 45 | set fillchars+=vert:\║ | " cool vertical split char |
| 46 | set fillchars+=diff:\ | " a whitespace gets used here | 46 | set fillchars+=diff:\ | " a white space gets used here |
| 47 | 47 | ||
| 48 | set listchars= | " initialize empty listchars | 48 | set listchars= | " initialize empty listchars |
| 49 | set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) | 49 | set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) |
| @@ -63,6 +63,9 @@ end | |||
| 63 | " SPELL_CHECKING | 63 | " SPELL_CHECKING |
| 64 | "======================================================================================================================= | 64 | "======================================================================================================================= |
| 65 | let g:spellfile_URL='http://ftp.vim.org/vim/runtime/spell' | 65 | let g:spellfile_URL='http://ftp.vim.org/vim/runtime/spell' |
| 66 | " add local user default spell file as primary source for words | ||
| 67 | let &spellfile=fnamemodify($MYVIMRC, ":p:h")."/spell/spellfile-user.UTF-8.add" | ||
| 68 | |||
| 66 | set nospell | " disable spell checker by default | 69 | set nospell | " disable spell checker by default |
| 67 | set spelllang=en,de | " languages for the spell checker | 70 | set spelllang=en,de | " languages for the spell checker |
| 68 | set spellsuggest=10 | " how many words will z= suggest? | 71 | set spellsuggest=10 | " how many words will z= suggest? |
| @@ -74,7 +77,7 @@ set complete+=i " scan current and included files | |||
| 74 | set complete+=d " scan current and included files for defined name or macro | 77 | set complete+=d " scan current and included files for defined name or macro |
| 75 | 78 | ||
| 76 | "======================================================================================================================= | 79 | "======================================================================================================================= |
| 77 | " Cscope | 80 | " cscope |
| 78 | "======================================================================================================================= | 81 | "======================================================================================================================= |
| 79 | " http://vim.wikia.com/wiki/Cscope | 82 | " http://vim.wikia.com/wiki/Cscope |
| 80 | if has('cscope') " compiled with cscope support? | 83 | if has('cscope') " compiled with cscope support? |
| @@ -138,8 +141,8 @@ if has("gui_running") | |||
| 138 | set guiheadroom=0 | 141 | set guiheadroom=0 |
| 139 | set guioptions+=eig | 142 | set guioptions+=eig |
| 140 | set guioptions-=T | " toolbar | 143 | set guioptions-=T | " toolbar |
| 141 | set guioptions+=c | " use console dialogs instead of popups | 144 | set guioptions+=c | " use console dialogues instead of popups |
| 142 | set guioptions+=a | " autoselect: copy&paste using middleclick | 145 | set guioptions+=a | " auto select: copy&paste using middle click |
| 143 | set guioptions+=m | " remove menu | 146 | set guioptions+=m | " remove menu |
| 144 | set guioptions-=e | " do not display tabs | 147 | set guioptions-=e | " do not display tabs |
| 145 | set guioptions-=L | " do not show left scrollbar | 148 | set guioptions-=L | " do not show left scrollbar |
| @@ -163,7 +166,7 @@ if has("gui_running") | |||
| 163 | set guifont+=Droid\ Sans\ Mono\ for\ Powerline\ 10 | 166 | set guifont+=Droid\ Sans\ Mono\ for\ Powerline\ 10 |
| 164 | set guifont+=Meslo\ LG\ M\ for\ Powerline\ 10 | 167 | set guifont+=Meslo\ LG\ M\ for\ Powerline\ 10 |
| 165 | 168 | ||
| 166 | " like in the terminal: use ctrl-shift-v for paste in vim's command editor | 169 | " like in the terminal: use Ctrl-shift-v for paste in vim's command editor |
| 167 | cnoremap <c-s-v> <c-r>* | 170 | cnoremap <c-s-v> <c-r>* |
| 168 | endif | 171 | endif |
| 169 | 172 | ||
| @@ -173,34 +176,34 @@ endif | |||
| 173 | set breakindent | " Every wrapped line will continue visually indented | 176 | set breakindent | " Every wrapped line will continue visually indented |
| 174 | set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) | 177 | set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) |
| 175 | set concealcursor=nc | " limits the display of concealed text to normal and command mode | 178 | set concealcursor=nc | " limits the display of concealed text to normal and command mode |
| 176 | set conceallevel=2 | " replace escaped chars by their utf-8 representation (useful for LaTeX) | 179 | set conceallevel=2 | " replace escaped chars by their UTF-8 representation (useful for LaTeX) |
| 177 | set confirm | " asks 'do you want to save?' | 180 | set confirm | " asks 'do you want to save?' |
| 178 | set cpoptions+=P | " makes :w filename set the current buffer to filename | 181 | set cpoptions+=P | " makes :w filename set the current buffer to filename |
| 179 | set hidden | " allows switiching buffers even if the current buffer contains changes (displays +) | 182 | set hidden | " allows switching buffers even if the current buffer contains changes (displays +) |
| 180 | set linebreak | " wrap long lines at char 'breakat', not inside words | 183 | set linebreak | " wrap long lines at char 'breakat', not inside words |
| 181 | set mousemodel=popup | " only in gvim: right click opens a popup-menu | 184 | set mousemodel=popup | " only in gvim: right click opens a pop-up-menu |
| 182 | set mouse=n | " allow mouse in normal mode only, so one can use the terminals c&p feature in insert mode | 185 | set mouse=n | " allow mouse in normal mode only, so one can use the terminals c&p feature in insert mode |
| 183 | set noautochdir | " When on, Vim will change the current working directory | 186 | set noautochdir | " When on, Vim will change the current working directory |
| 184 | set nostartofline | " when scrolling: do not move the cursor to column 1 | 187 | set nostartofline | " when scrolling: do not move the cursor to column 1 |
| 185 | set nowrap | " but do not (by default) wrap long lines around | 188 | set nowrap | " but do not (by default) wrap long lines around |
| 186 | set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers | 189 | set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers |
| 187 | set path+=** | " allow recursive searches for files | 190 | set path+=** | " allow recursive searches for files |
| 188 | set incsearch | " highlight pattern while entering it (performancewise this isn't that good) | 191 | set incsearch | " highlight pattern while entering it (performance wise this isn't that good) |
| 189 | set pumheight=8 | " Determines the maximum number of items to show in the popup menu for | 192 | set pumheight=8 | " Determines the maximum number of items to show in the pop-up menu for |
| 190 | set scrolljump=5 | " how many lines get scrolled into view when cursor reaches the screens edge | 193 | set scrolljump=5 | " how many lines get scrolled into view when cursor reaches the screens edge |
| 191 | set scrolloff=0 | " keeps cursor centered | 194 | set scrolloff=0 | " keeps cursor centered |
| 192 | set shiftround | " indent/unindent snaps to multiple of shiftwidths | 195 | set shiftround | " indent/un-indent snaps to multiple of shiftwidths |
| 193 | set writedelay=0 | 196 | set writedelay=0 |
| 194 | 197 | ||
| 195 | " display and performance | 198 | " display and performance |
| 196 | set lazyredraw | " disables redraw during macro exectution (improves performance) | 199 | set lazyredraw | " disables redraw during macro execution (improves performance) |
| 197 | set cmdheight=2 | " sets the command line's height | 200 | set cmdheight=2 | " sets the command line's height |
| 198 | set signcolumn=yes | " auto=auto hide, yes=always, no=never show the column with error indicators | 201 | set signcolumn=yes | " auto=auto hide, yes=always, no=never show the column with error indicators |
| 199 | set nocursorcolumn | " turn visual cursor column off (improves performance) | 202 | set nocursorcolumn | " turn visual cursor column off (improves performance) |
| 200 | set updatetime=80 | " updates the screen more often | 203 | set updatetime=80 | " updates the screen more often |
| 201 | set redrawtime=1500 | " Timeout in milliseconds for redrawing the screen (switches syntax off when ssh too slow) / CTRL+L to retry | 204 | set redrawtime=1500 | " Timeout in milliseconds for redrawing the screen (switches syntax off when ssh too slow) / CTRL+L to retry |
| 202 | set notimeout | " improves performance but is known to cause problems on slow terminals | 205 | set notimeout | " improves performance but is known to cause problems on slow terminals |
| 203 | set ttimeout ttimeoutlen=150 | " set esc key timeout in ms- | 206 | set ttimeout ttimeoutlen=150 | " set Esc key timeout in ms- |
| 204 | set showcmd | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering) | 207 | set showcmd | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering) |
| 205 | set showtabline=2 | " 0: never, 1: only if there are at least two tabs, 2:always | 208 | set showtabline=2 | " 0: never, 1: only if there are at least two tabs, 2:always |
| 206 | set shortmess+=I | " don't give the intro message when starting Vim |:intro|. | 209 | set shortmess+=I | " don't give the intro message when starting Vim |:intro|. |
| @@ -247,12 +250,12 @@ set noautoindent | |||
| 247 | set nosmartindent | 250 | set nosmartindent |
| 248 | set cindent cinoptions+=(0 | " indent at parentheses | 251 | set cindent cinoptions+=(0 | " indent at parentheses |
| 249 | 252 | ||
| 250 | set noshiftround | " indent/unindent sna=ps to multiple of shiftwidths | 253 | set noshiftround | " indent/un-indent sna=ps to multiple of shiftwidths |
| 251 | set equalalways | " do not evenly size windows when opening new or closing old | 254 | set equalalways | " do not evenly size windows when opening new or closing old |
| 252 | set nocursorline | " turn visual cursor line off (improves performance) | 255 | set nocursorline | " turn visual cursor line off (improves performance) |
| 253 | "======================================================================================================================= | 256 | "======================================================================================================================= |
| 254 | 257 | ||
| 255 | " Vim8 has a terminal command... | 258 | " Vim 8 has a terminal command... |
| 256 | if has('terminal') | 259 | if has('terminal') |
| 257 | " use default ESC key to leave insert mode in the internal terminal emulator | 260 | " use default ESC key to leave insert mode in the internal terminal emulator |
| 258 | tnoremap <Esc> <C-W>N | 261 | tnoremap <Esc> <C-W>N |
| @@ -262,7 +265,7 @@ endif | |||
| 262 | 265 | ||
| 263 | 266 | ||
| 264 | " NEOVIM_incompatible: | 267 | " NEOVIM_incompatible: |
| 265 | " | 268 | " |
| 266 | if has('nvim') " Neovim? | 269 | if has('nvim') " Neovim? |
| 267 | autocmd TermOpen term://* set nobuflisted | 270 | autocmd TermOpen term://* set nobuflisted |
| 268 | " use default ESC key to leave insert mode in the internal terminal emulator | 271 | " use default ESC key to leave insert mode in the internal terminal emulator |
| @@ -276,13 +279,13 @@ else " default Vim? | |||
| 276 | autocmd VimLeave * call system("echo -n $'" . escape(getreg(), "'") . "' | xsel -ib") | 279 | autocmd VimLeave * call system("echo -n $'" . escape(getreg(), "'") . "' | xsel -ib") |
| 277 | 280 | ||
| 278 | set ttymouse=xterm2 | 281 | set ttymouse=xterm2 |
| 279 | set ttyscroll=100 | " improves speed for terminal vim, incomp. with nvim | 282 | set ttyscroll=100 | " improves speed for terminal vim, incompatible with nvim |
| 280 | set ttyfast | " improves speed for terminal vim (incomp. with nvim) | 283 | set ttyfast | " improves speed for terminal vim (incompatible with nvim) |
| 281 | set nottybuiltin | " use external termcaps | 284 | set nottybuiltin | " use external termcaps |
| 282 | set restorescreen | " restores the console after exiting vim (intentionally not in nvim) | 285 | set restorescreen | " restores the console after exiting vim (intentionally not in nvim) |
| 283 | " | 286 | " |
| 284 | let g:loaded_ruby_provider = 1 " disable ruby support | 287 | let g:loaded_ruby_provider = 1 " disable ruby support |
| 285 | let g:loaded_python_provider = 1 " disable pthon3 | 288 | let g:loaded_python_provider = 1 " disable python 3 |
| 286 | 289 | ||
| 287 | if version >= 702 " clean up (see: http://vim.wikia.com/wiki/VimTip396) | 290 | if version >= 702 " clean up (see: http://vim.wikia.com/wiki/VimTip396) |
| 288 | autocmd BufWinLeave * call clearmatches() | 291 | autocmd BufWinLeave * call clearmatches() |
| @@ -480,7 +483,7 @@ if has("autocmd") | |||
| 480 | \ <F9> | 483 | \ <F9> |
| 481 | 484 | ||
| 482 | if has("gui_running") == 0 | 485 | if has("gui_running") == 0 |
| 483 | " in the gui F10 already triggeres the menu, not in a terminal vim, so upgrade that... | 486 | " in the gui F10 already triggers the menu, not in a terminal vim, so upgrade that... |
| 484 | map <F10> :emenu <C-Z> | 487 | map <F10> :emenu <C-Z> |
| 485 | endif | 488 | endif |
| 486 | 01menu &Functions.activate\ menu\ (:emenu) | 489 | 01menu &Functions.activate\ menu\ (:emenu) |
| @@ -591,7 +594,7 @@ if has("autocmd") | |||
| 591 | 1000menu &Tag.stack.jump\ older | 594 | 1000menu &Tag.stack.jump\ older |
| 592 | \<Tab><C-T> | 595 | \<Tab><C-T> |
| 593 | \ :po | 596 | \ :po |
| 594 | 1000menu &Tag.stack.jump\ | 597 | 1000menu &Tag.stack.jump\ |
| 595 | \<Tab>:ta | 598 | \<Tab>:ta |
| 596 | \ :ta | 599 | \ :ta |
| 597 | endif | 600 | endif |
| @@ -614,12 +617,12 @@ endif | |||
| 614 | " inoremap <C-Space> <C-x><C-o> | 617 | " inoremap <C-Space> <C-x><C-o> |
| 615 | " inoremap <C-@> <C-Space> | 618 | " inoremap <C-@> <C-Space> |
| 616 | 619 | ||
| 617 | " Bind CTRL+Backspace to vims version (CTRL+W) in " <CR> insert mode (only works with gvim) | 620 | " Bind CTRL+Backspace to vim's version (CTRL+W) in " <CR> insert mode (only works with gvim) |
| 618 | inoremap | 621 | inoremap |
| 619 | \ <C-Backspace> | 622 | \ <C-Backspace> |
| 620 | \ <C-W> | 623 | \ <C-W> |
| 621 | 624 | ||
| 622 | " INDENTATION: allows deindenting a selected block and keeps selection | 625 | " INDENTATION: allows un-indenting a selected block and keeps selection |
| 623 | vnoremap < <gv | 626 | vnoremap < <gv |
| 624 | vnoremap > >gv | 627 | vnoremap > >gv |
| 625 | 628 | ||
| @@ -754,7 +757,7 @@ Plug 'itchyny/lightline.vim' | |||
| 754 | " Plug 'taohex/lightline-buffer' | 757 | " Plug 'taohex/lightline-buffer' |
| 755 | 758 | ||
| 756 | " lightline-buffer ui settings | 759 | " lightline-buffer ui settings |
| 757 | " replace these symbols with ascii characters if your environment does not support unicode | 760 | " replace these symbols with ASCII characters if your environment does not support unicode |
| 758 | let g:lightline_buffer_logo = '' | 761 | let g:lightline_buffer_logo = '' |
| 759 | let g:lightline_buffer_readonly_icon = '' | 762 | let g:lightline_buffer_readonly_icon = '' |
| 760 | let g:lightline_buffer_modified_icon = '✭' | 763 | let g:lightline_buffer_modified_icon = '✭' |
| @@ -1049,7 +1052,7 @@ endfunction | |||
| 1049 | autocmd! ColorScheme * call ExtendColorTheme() | 1052 | autocmd! ColorScheme * call ExtendColorTheme() |
| 1050 | 1053 | ||
| 1051 | 1054 | ||
| 1052 | set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) incomp. with nvim | 1055 | set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) incompatible with nvim |
| 1053 | " set t_ut= | 1056 | " set t_ut= |
| 1054 | 1057 | ||
| 1055 | if filereadable(expand("~/.vimrc_background")) && filereadable(expand("~/.config/base16-shell/colortest")) | 1058 | if filereadable(expand("~/.vimrc_background")) && filereadable(expand("~/.config/base16-shell/colortest")) |
| @@ -1079,6 +1082,6 @@ endif | |||
| 1079 | " endif | 1082 | " endif |
| 1080 | 1083 | ||
| 1081 | autocmd VimEnter,WinEnter * exec ':set scrolljump='.winheight(0)/2 | 1084 | autocmd VimEnter,WinEnter * exec ':set scrolljump='.winheight(0)/2 |
| 1082 | 1085 | ||
| 1083 | " display highlight group under the cursor | 1086 | " display highlight group under the cursor |
| 1084 | map <leader>h :echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')<CR> | 1087 | map <leader>h :echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')<CR> |
