aboutsummaryrefslogtreecommitdiff
path: root/.vimrc
diff options
context:
space:
mode:
authorclaw0ry <me@claw0ry.net>2024-12-11 13:58:21 +0100
committerclaw0ry <me@claw0ry.net>2024-12-11 13:58:21 +0100
commitb56b0d3ca316395a903ed1c7a040bda0ae321c36 (patch)
treeda8a7e975f0f426095350403dc3b39f4fd1ad5dd /.vimrc
fresh start
Diffstat (limited to '.vimrc')
-rw-r--r--.vimrc148
1 files changed, 148 insertions, 0 deletions
diff --git a/.vimrc b/.vimrc
new file mode 100644
index 0000000..d6c7e10
--- /dev/null
+++ b/.vimrc
@@ -0,0 +1,148 @@
+set encoding=utf-8
+scriptencoding utf-8
+lang en_US.UTF-8
+
+" use space as <leader> key
+let mapleader=" "
+
+set nu
+set relativenumber
+
+" syntax highlighting
+syntax on
+filetype plugin indent on
+
+set backspace=indent,eol,start
+
+" indentation
+set tabstop=4
+set softtabstop=4
+set shiftwidth=4
+set expandtab
+set smartindent
+set autoindent
+
+" copy paste clipboard
+set clipboard=unnamed
+
+" highlight current line
+set cursorline
+
+" searching
+set incsearch
+set ignorecase
+set smartcase
+set nohlsearch
+
+" display title of current file in terminal title bar
+set title
+
+" allow hidden buffers
+set hidden
+
+" dont wrap long lines
+set nowrap
+
+" disable swaps and backups
+set noswapfile
+set nobackup
+set nowritebackup
+
+" start scrolling when 8 lines left
+set scrolloff=8
+
+" show sign column
+set signcolumn=yes
+
+" show the colorcolumn
+set colorcolumn=120
+
+" :sp and :vsp should split below and to the right
+set splitbelow
+set splitright
+
+" avoid delays when typing
+set updatetime=50
+
+" enable mouse support
+set mouse=a
+
+" ???
+set completeopt="menu,menuone,noselect"
+
+" show whitespace characters
+set list lcs=tab:>\ ,trail:~,precedes:<,space:\ ,nbsp:×
+
+" set correct filetype for terraform files
+autocmd BufRead,BufNewFile *.tf,*.tfvars set filetype=terraform
+
+" ---------------------------------
+" --- KEYBINDINGS
+" --------------------------------
+
+" open file explorer
+nnoremap <leader>pv :Ex<CR>
+
+" copy the whole file and stay where you are
+nnoremap <leader>yy ggVGy<C-o>
+
+" move visual line(s) up and down
+vnoremap J :m '>+1<CR>gv=gv
+vnoremap K :m '<-2<CR>gv=gv
+
+" move line up/down
+nnoremap <S-Up> :m-2<CR>
+nnoremap <S-Down> :m+1<CR>
+
+" keeps search in the middle (n=next, N=previous)
+nnoremap n nzzzv
+nnoremap N Nzzzv
+
+" keeps half page up/down in the middle
+nnoremap <C-d> <C-d>zz
+nnoremap <C-u> <C-u>zz
+
+" delete highlighted word/line into void and keeps the pasted value
+" in default registry so you can paste many times
+xnoremap <leader>p "_dp
+
+" delete to void
+nnoremap <leader>d "_d
+vnoremap <leader>d "_d
+
+" fzf
+nnoremap <C-f> :GFiles<CR>
+nnoremap <leader>ff :Files<CR>
+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
+cabbr Q q
+cabbr E e
+
+" ----------------------
+" --- 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' }
+call plug#end()
+
+
+" ----------------------
+" --- THEME
+" ----------------------
+
+set background=dark
+colorscheme habamax