summaryrefslogtreecommitdiff
path: root/vim-new/vimrc
blob: 3d54db547aca4b466ca54e646a5696bb666b3f62 (plain)
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
" Miguel's Fresh Vimrc "
" Started from scratch on 29th Apr 2021

" {{{ vim-plug
call plug#begin('~/.vim/plugged')

Plug 'rafi/awesome-vim-colorschemes'
Plug 'jnurmine/Zenburn'

Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'

Plug 'junegunn/fzf',                   { 'do': { -> fzf#install() }                }
Plug 'junegunn/fzf.vim'

Plug 'autozimu/LanguageClient-neovim', { 'branch': 'next', 'do': 'bash install.sh' }

Plug 'neovimhaskell/haskell-vim'
Plug 'alx741/vim-stylishask'

call plug#end()
" }}}

" {{{ misc

" colorscheme desert
" colorscheme gruvbox
colorscheme zenburn

set nocompatible
set foldmethod=marker
set nowrap
set showcmd
set number
set hidden
set colorcolumn=73
set backspace=2
" }}}

syntax on
filetype plugin indent on

let g:airline_powerline_fonts = 1

nnoremap <F5> :call LanguageClient_contextMenu()<CR>
let g:LanguageClient_serverCommands = { 'haskell': ['haskell-language-server-wrapper', '--lsp'] }
let g:LanguageClient_diagnosticsDisplay = {
    \        1: {
    \            "name": "Error",
    \            "texthl": "LanguageClientError",
    \            "signText": "X",
    \            "signTexthl": "LanguageClientErrorSign",
    \            "virtualTexthl": "Error"
    \           },
    \        2: {
    \            "name": "Warning",
    \            "texthl": "LanguageClientWarning",
    \            "signText": "W",
    \            "signTexthl": "LanguageClientWarningSign",
    \            "virtualTexthl": "Todo",
    \        },
    \        3: {
    \            "name": "Information",
    \            "texthl": "LanguageClientInfo",
    \            "signText": "i",
    \            "signTexthl": "LanguageClientInfoSign",
    \            "virtualTexthl": "Todo",
    \        },
    \        4: {
    \            "name": "Hint",
    \            "texthl": "LanguageClientInfo",
    \            "signText": "!",
    \            "signTexthl": "LanguageClientInfoSign",
    \            "virtualTexthl": "Todo",
    \        },
    \    }

let g:haskell_enable_quantification = 1   " to enable highlighting of `forall`
let g:haskell_enable_recursivedo = 1      " to enable highlighting of `mdo` and `rec`
let g:haskell_enable_arrowsyntax = 1      " to enable highlighting of `proc`
let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern`
let g:haskell_enable_typeroles = 1        " to enable highlighting of type roles
let g:haskell_enable_static_pointers = 1  " to enable highlighting of `static`
let g:haskell_backpack = 1                " to enable highlighting of backpack keywords

" {{{ tabs
set listchars=tab:>.
set tabstop=8
set expandtab
set softtabstop=4
set shiftwidth=4
set shiftround
" }}}

" {{{ folding
set foldcolumn=5
set foldlevelstart=0
" }}}

" {{{ search
set hlsearch
set incsearch
set smartcase
" }}}

" {{{ match brackets
set showmatch
set matchtime=5
" }}}
 
" {{{ KEY BINDINGS
" mapleader
" use <space> but remap to _ so it is visible for 'showcmd'
nmap <space> _
let mapleader="\_"
let maplocalleader="\_"

" get rid of bad habits. (might break other stuff eg. in cygwin)
" inoremap <esc> <nop>
" inoremap <Up> <nop>
" inoremap <Down> <nop>
" inoremap <Left> <nop>
" inoremap <Right> <nop>

" activate 'very magic' for searches automatically
nnoremap / /\v
nnoremap ? ?\v

" alt esc in insert mode
inoremap jk <esc>

" toggle tabs visibility
noremap <leader>t :set invlist<CR>

" easy editing and sourcing of vimrc
" nnoremap <leader>sv :source $MYVIMRC<cr>
nnoremap <leader>ev :e $MYVIMRC<cr>

" turn off search highlight
nnoremap <leader>h :nohlsearch<cr>

" layout
"nnoremap <leader>ln :NERDTreeToggle<cr>

" silver search
"noremap <leader>a :Ack!<Space>

" show list if multiple ctrl-] matches
nnoremap <C-]> g<C-]>

" ctrl-space auto complete in insert mode
inoremap <C-Space> <C-N>

" FZF settings
nmap <leader>f :Files<cr>|     " fuzzy find files in the working directory (where you launched Vim from)
nmap <leader>/ :BLines<cr>|    " fuzzy find lines in the current file
nmap <leader>b :Buffers<cr>|   " fuzzy find an open buffer
nmap <leader>r :Rg |           " fuzzy find text in the working directory
nmap <leader>c :Commands<cr>|  " fuzzy find Vim commands (like Ctrl-Shift-P in Sublime/Atom/VSC)
nmap <leader>t :Tags<cr>|      " fuzzy find tags
" }}}