mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
@@ -11,7 +11,7 @@ A collection of language packs for Vim.
|
|||||||
- It is also more secure (scripts loaded for every filetype are generated by vim-polyglot)
|
- It is also more secure (scripts loaded for every filetype are generated by vim-polyglot)
|
||||||
- Best syntax and indentation support (no other features). Hand-selected language packs.
|
- Best syntax and indentation support (no other features). Hand-selected language packs.
|
||||||
- Automatically detects indentation (includes performance-optimized version of [vim-sleuth](https://github.com/tpope/vim-sleuth), can be disabled)
|
- Automatically detects indentation (includes performance-optimized version of [vim-sleuth](https://github.com/tpope/vim-sleuth), can be disabled)
|
||||||
- Includes defaults from [vim-sensible](https://github.com/tpope/vim-sensible), which are usually necessary for editing in any language (can be disabled)
|
- Includes some defaults from [vim-sensible](https://github.com/tpope/vim-sensible), which are usually necessary for editing in any language (can be disabled)
|
||||||
|
|
||||||
\*To be completely honest, optimized `ftdetect` script takes around `10ms` to load.
|
\*To be completely honest, optimized `ftdetect` script takes around `10ms` to load.
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ endif
|
|||||||
|
|
||||||
" Code taken from https://github.com/tpope/vim-sensible
|
" Code taken from https://github.com/tpope/vim-sensible
|
||||||
" and (mostly comments) from https://github.com/sheerun/vimrc
|
" and (mostly comments) from https://github.com/sheerun/vimrc
|
||||||
|
"
|
||||||
|
" Only settings that matter for proper editing are left
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sensible')
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sensible')
|
||||||
" Autoindent when starting new line, or using `o` or `O`.
|
" Autoindent when starting new line, or using `o` or `O`.
|
||||||
set autoindent
|
set autoindent
|
||||||
@@ -22,16 +24,6 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sensible')
|
|||||||
" Allow backspace in insert mode.
|
" Allow backspace in insert mode.
|
||||||
set backspace=indent,eol,start
|
set backspace=indent,eol,start
|
||||||
|
|
||||||
" Don't scan included files. The .tags file is more performant.
|
|
||||||
set complete-=i
|
|
||||||
|
|
||||||
" Use 'shiftwidth' when using `<Tab>` in front of a line.
|
|
||||||
" By default it's used only for shift commands (`<`, `>`).
|
|
||||||
set smarttab
|
|
||||||
|
|
||||||
" Disable octal format for number processing.
|
|
||||||
set nrformats-=octal
|
|
||||||
|
|
||||||
" Allow for mappings including `Esc`, while preserving
|
" Allow for mappings including `Esc`, while preserving
|
||||||
" zero timeout after pressing it manually.
|
" zero timeout after pressing it manually.
|
||||||
" (only vim needs a fix for this)
|
" (only vim needs a fix for this)
|
||||||
@@ -43,33 +35,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sensible')
|
|||||||
" Enable highlighted case-insensitive incremential search.
|
" Enable highlighted case-insensitive incremential search.
|
||||||
set incsearch
|
set incsearch
|
||||||
|
|
||||||
" Use <C-L> to clear the highlighting of :set hlsearch.
|
" Use utf-8 encoding by default
|
||||||
if maparg('<C-L>', 'n') ==# ''
|
|
||||||
nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Always show window statuses, even if there's only one.
|
|
||||||
set laststatus=2
|
|
||||||
|
|
||||||
" Show the line and column number of the cursor position.
|
|
||||||
set ruler
|
|
||||||
|
|
||||||
" Autocomplete commands using nice menu in place of window status.
|
|
||||||
" Enable `Ctrl-N` and `Ctrl-P` to scroll through matches.
|
|
||||||
set wildmenu
|
|
||||||
|
|
||||||
" Keep 5 columns next to the cursor when scrolling horizontally.
|
|
||||||
if !&scrolloff
|
|
||||||
set scrolloff=1
|
|
||||||
endif
|
|
||||||
if !&sidescrolloff
|
|
||||||
set sidescrolloff=5
|
|
||||||
endif
|
|
||||||
|
|
||||||
" When 'wrap' is on, display last line even if it doesn't fit.
|
|
||||||
set display+=lastline
|
|
||||||
|
|
||||||
" Force utf-8 encoding
|
|
||||||
set encoding=utf-8
|
set encoding=utf-8
|
||||||
|
|
||||||
" Set default whitespace characters when using `:set list`
|
" Set default whitespace characters when using `:set list`
|
||||||
@@ -82,10 +48,10 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sensible')
|
|||||||
set formatoptions+=j
|
set formatoptions+=j
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Search upwards for tags file instead only locally
|
" Search upwards for tags file instead only locally
|
||||||
if has('path_extra')
|
if has('path_extra')
|
||||||
setglobal tags-=./tags tags-=./tags; tags^=./tags;
|
setglobal tags-=./tags tags-=./tags; tags^=./tags;
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Fix issues with fish shell
|
" Fix issues with fish shell
|
||||||
" https://github.com/tpope/vim-sensible/issues/50
|
" https://github.com/tpope/vim-sensible/issues/50
|
||||||
|
|||||||
Reference in New Issue
Block a user