all repos

dotfiles @ 04331d3e9479176b5ffdfdd8dfc197e052801a37

my dotfiles

config/nvim/init.vim (view raw)

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
call plug#begin('~/.vim/plugged')
  Plug 'Smirnov-O/nten.vim'
  Plug 'jiangmiao/auto-pairs'
  Plug 'sheerun/vim-polyglot'
call plug#end()

"== General
colo nten-light        " Color scheme
set nu rnu             " Line numbers
set cursorline         " Highlight line by cursor
set linebreak wrap     " Line wrap
set mouse=a mousehide  " Mouse
set ruler laststatus=0 " Status line
set history=500        " Set history size
set autoread           " Auto read file on change
set hidden             " Change buffet without warning
set visualbell t_vb=   " Disable sounds
set pumheight=8        " Maximum items in pop up
set modeline           " Enable modeline
set nobk noswf noudf   " Swap files
set is ic scs          " Search
set scrolloff=3
set enc=utf-8 fenc=utf-8  " Encoding
set list listchars=tab:\|·,trail:~,space:·

" Tab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set smarttab
set expandtab
set autoindent

"== Netrw file manager
let g:netrw_liststyle=3
let g:netrw_banner=0
let g:netrw_dirhistmax=0

"== Custom setting for another files
au FileType python,elm setlocal ex sw=4 ts=4
au FileType javascript,javascriptreact,json,yaml setlocal ex sw=2 ts=2

"== Custom commands
com! Term     :vs|winc L|se nu! rnu!|start|term
com! Prettier :silent !prettier -w %
com! Black    :silent !black %
com! ElmFmt   :silent !elm-format --yes %
com! GoFmt    :silent !gofmt -w %

"== Mapping
let mapleader=";"
nn <C-S> :w<cr>
nn <leader>t :Term<cr>
nn <space> :noh<cr>
nn <leader>j :bn<cr>
nn <leader>k :bp<cr>
nn <leader>w :bd<cr>
nn <C-h> :wincmd h<cr>
nn <C-j> :wincmd j<cr>
nn <C-k> :wincmd k<cr>
nn <C-l> :wincmd l<cr>
tno <esc> <c-\><c-n>
nn spv :vs<cr>
nn sph :sp<cr>