aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclaw0ry <me@claw0ry.net>2025-01-02 14:13:09 +0100
committerclaw0ry <me@claw0ry.net>2025-01-02 14:13:09 +0100
commitdb99647186c7df6eec0012f5d275566878f71dae (patch)
tree8541ebd050f3a8660e083e90304e93070e4db729
parentvim: vertical bar in insert mode (diff)
vim: reorganize and add ultisnips
-rw-r--r--.vimrc51
1 files changed, 31 insertions, 20 deletions
diff --git a/.vimrc b/.vimrc
index 7eb4ff5..41d85ae 100644
--- a/.vimrc
+++ b/.vimrc
@@ -2,6 +2,25 @@ set encoding=utf8
scriptencoding utf8
lang en_US.UTF-8
+" ----------------------
+" --- PLUGINS
+" ----------------------
+
+call plug#begin()
+Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
+Plug 'junegunn/fzf.vim'
+Plug 'jremmen/vim-ripgrep'
+Plug 'tpope/vim-commentary'
+Plug 'tpope/vim-surround'
+Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
+Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}
+Plug 'SirVer/ultisnips'
+call plug#end()
+
+" ----------------------
+" --- GENERAL
+" ----------------------
+
" use space as <leader> key
let mapleader=" "
@@ -12,6 +31,10 @@ set relativenumber
syntax on
filetype plugin indent on
+" vertical bar in insert mode, block in normal mode
+let &t_SI = "\e[6 q"
+let &t_EI = "\e[2 q"
+
set backspace=indent,eol,start
" indentation
@@ -76,18 +99,18 @@ set completeopt="noinsert,menuone,noselect"
" show whitespace characters
set list lcs=tab:>\ ,trail:~,precedes:<,space:\ ,nbsp:×
+" ---------------------------------
+" --- AUTOCOMMANDS
+" --------------------------------
+
" set correct filetype for terraform files
autocmd BufRead,BufNewFile *.tf,*.tfvars set filetype=terraform
" set correct comment string for powershell files
autocmd FileType ps1 setlocal commentstring=#\ %s
-" vertical bar in insert mode, block in normal mode
-let &t_SI = "\e[6 q"
-let &t_EI = "\e[2 q"
-
-" reset the cursor on start (for older versions of vim, usually not required)
-autocmd VimEnter * silent !echo -ne "\e[2 q"
+" reload file if changes from outside
+autocmd FocusGained,BufEnter * :checktime
" ---------------------------------
" --- KEYBINDINGS
@@ -130,9 +153,6 @@ nnoremap <leader>fg :Ag<CR>
nnoremap <leader>ffg :Rg
nnoremap <leader>b :Buffers
-" reload file if changes from outside
-autocmd FocusGained,BufEnter * :checktime
-
" avoid human error
cabbr W w
cabbr Wq wq
@@ -140,19 +160,10 @@ cabbr Q q
cabbr E e
" ----------------------
-" --- PLUGINS
+" --- SNIPPETS
" ----------------------
-call plug#begin()
-Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
-Plug 'junegunn/fzf.vim'
-Plug 'jremmen/vim-ripgrep'
-Plug 'tpope/vim-commentary'
-Plug 'tpope/vim-surround'
-Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
-Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}
-call plug#end()
-
+let g:UltiSnipsSnippetDirectories=[$HOME.'/.local/snippets']
" ----------------------
" --- THEME