paulbsd-salt/states/vim/templates/vimrc.j2

54 lines
1.5 KiB
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
"{{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
{%- from "vim/map.jinja" import vim with context %}
2021-09-25 16:06:06 +02:00
" VIM global configs
2020-07-10 00:58:55 +02:00
colorscheme {{ vim.config.use_theme }}
filetype plugin on
{%- if vim.config.use_syntax %}
syntax on
{%- endif %}
2021-09-25 16:06:06 +02:00
{% macro cfg(command, setting) -%}
{% for key, value in setting.items() %}
{{ command }} {{ value.name }}{% if value.value is defined %}={{ value.value }}{% endif %}
2020-07-10 00:58:55 +02:00
{%- endfor %}
2021-09-25 16:06:06 +02:00
{% endmacro -%}
" VIM lets
{{- cfg("let", vim.config.lets) }}
" VIM sets
{{- cfg("set", vim.config.sets) }}
2020-07-10 00:58:55 +02:00
2020-09-06 16:30:57 +02:00
nnoremap <F9> :!%:p
2020-07-10 00:58:55 +02:00
if has("autocmd")
au VimEnter,InsertLeave * silent execute '!echo -ne "\e[2 q"' | redraw!
au InsertEnter,InsertChange *
2023-03-10 00:06:58 +01:00
\ if v:insertmode == 'i' |
2020-07-10 00:58:55 +02:00
\ silent execute '!echo -ne "\e[6 q"' | redraw! |
\ elseif v:insertmode == 'r' |
\ silent execute '!echo -ne "\e[4 q"' | redraw! |
\ endif
au VimLeave * silent execute '!echo -ne "\e[ q"' | redraw!
2020-09-06 16:30:57 +02:00
endif
2020-09-27 21:12:04 +02:00
" NERDTree
2021-09-25 16:06:06 +02:00
set wildignore+=*.pyc,*.o,*.obj,*.svn,*.swp,*.class,*.hg,*.DS_Store,*.min.*
2020-09-27 21:12:04 +02:00
let g:NERDTreeShowHidden = 1
let g:NERDTreeMinimalUI = 1
let g:NERDTreeIgnore = []
let g:NERDTreeStatusline = ''
2021-09-25 16:06:06 +02:00
let g:NERDTreeRespectWildIgnore=1
2020-09-27 21:12:04 +02:00
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
2021-09-25 16:06:06 +02:00
nnoremap <silent> <C-b> :NERDTreeToggle<CR>
" Support for end-of-lines
" au BufWritePre * :set binary | set noeol
2021-12-29 15:45:48 +01:00
" au BufWritePost * :set nobinary | set eol
vnoremap <C-a> g<C-a>
vnoremap <C-x> g<C-x>
vnoremap g<C-a> <C-a>
2023-03-10 00:06:58 +01:00
vnoremap g<C-x> <C-x>