aboutsummaryrefslogtreecommitdiffstats
path: root/vim/vimrc
blob: 14cec539ff768ba01ec0af5268831b051bcfe6a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
filetype plugin on
filetype indent on
syntax on

" leader
let maplocalleader = "\\"
let mapleader = ","


" related to https://oleksii.shmalko.com/2014/using-vim-as-c-cpp-ide/
" to enable putting a config file in the proejct directory
set exrc
set secure

set nocompatible
set scrolloff=1
set history=799
set wildignore=**/__pycache*/**
set wildoptions=pum
set wildmenu
set wildchar=<TAB>
set showmatch
set ruler
set showcmd
set nohlsearch
set incsearch
set ignorecase
set smartindent
set smartcase
set tabstop=4
set softtabstop=4
set shiftwidth=4
set splitbelow 
set noswapfile
set nobackup
set splitright
set autoindent
set expandtab
set hidden
set path+=**
set relativenumber
set number
set more
set signcolumn=number
set colorcolumn=0
set equalalways
set showmode
set list
" set listchars=tab:»-,trail:␣,leadmultispace:---+,eol:\\U000021b5
set listchars=tab:»-,trail:␣
set shortmess+=c
set tags+=./tags
set completeopt=menuone,longest
set omnifunc=syntaxcomplete#Complete

call plug#begin()
Plug 'dense-analysis/ale'
Plug 'mhinz/vim-signify'
Plug 'tpope/vim-dispatch'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-commentary'
Plug 'SirVer/UltiSnips'
Plug 'honza/vim-snippets'
Plug 'ledger/vim-ledger'
" Plug 'sheerun/vim-polyglot'

call plug#end()

let g:ale_linters = {'python': ['pyright', 'flake8', 'mypy'],
\           		'javascript': ['eslint'],
\                    'cpp': ['clangd'],
\                    'yaml': ['yamllint'],
\                    'c': ['clangd'],
\                    'go': ['gopls', 'golint', 'gofmt'],
\}
let g:ale_fixers = {
\           	'python': ['autoimport', 'isort', 'yapf', 'black'],
\      			'javascript': ['eslint'],
\           	'go': ['gofmt'],
\      			'cpp': ['clang-format'],
\      			'c': ['clang-format'],
\           	'rust': ['rustfmt']
\}
let g:ale_fix_on_save = 1
let g:ale_sign_column_always = 1
set omnifunc=ale#completion#OmniFunc


" Open vimrc
nnoremap <leader>ev <C-w>s<C-w>j<C-w>L:e $HOME/.vim/vimrc<cr>

" Make :grep use ripgrep
if executable('rg')
    set grepprg=rg\ --color=never\ --vimgrep
endif

" and search with ripgrep
command! -bang -nargs=* Rg
      \ call fzf#vim#grep(
      \   'rg --column --line-number --no-heading --color=always --ignore-case '.shellescape(<q-args>), 1,
      \   <bang>0 ? fzf#vim#with_preview('up:60%')
      \           : fzf#vim#with_preview('right:50%:hidden', '?'),
      \   <bang>0)

nnoremap <C-p>a :Rg 

" clear search highlights
nnoremap <leader><space> :noh<cr>:call clearmatches()<cr>

runtime macros/matchit.vim	"allows jumping between brackets with % in normal mode

" remap :W to :w - :W was previous Windows in fzf
command! W w

if (has("termguicolors"))
	set termguicolors
endif

set background=dark
colorscheme gruber-darker