-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.vim
72 lines (64 loc) · 2.53 KB
/
init.vim
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
syntax enable
filetype plugin indent on
set noerrorbells "no sounds
set encoding=utf-8
set number "set numbers
set spelllang=en_us "used for spell checking
set autoindent "follow indentation
set smartindent "change indentation smartly...
set tabstop=4 softtabstop=4 "set hard and soft tabs to 4 spaces
set shiftwidth=4 "shift lines by 4 spaces (tab)
set expandtab "turns hard tabs into spaces
set shiftround "when tabbing and untabbing lines, go to the nearest rounded tab (multiple of shiftwidth)
set smartcase "case insensitive when no caps, case sens with caps
set noswapfile " don't use swap files for buffers
set nobackup " don't backup buffers
set undofile "set nvim to use a file for undo
set undodir=~/.config/nvim/undodir "set undo dir as undo file (and backup)
set hls "highlight search results
set is "highlight current matches when searching
set laststatus=2 "last window will always have a status line
set cmdheight=2 "height of command line
set noic "dont ignore case in search pattern
set wildmenu "enhanced command line completion
set termguicolors "enables 24-bit rgb
set clipboard=unnamedplus "set clipboard to system
call plug#begin('~/.config/nvim/plugged')
Plug 'morhetz/gruvbox'
Plug 'mbbill/undotree'
Plug 'scrooloose/nerdtree'
Plug 'sheerun/vim-polyglot'
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-surround'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'tpope/vim-characterize'
Plug 'ap/vim-css-color'
Plug 'rhysd/vim-clang-format'
Plug 'kassio/neoterm'
Plug 'rust-lang/rust.vim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
call plug#end()
" :CocInstall coc-rust-analyzer
autocmd FileType rust nnoremap <C-b> :Cbuild <Cr>
autocmd FileType sh nnoremap <C-b> :!bash % <Cr>
autocmd FileType python nnoremap <C-b> :!python3 % <Cr>
autocmd FileType make nnoremap <C-b> :!make
autocmd FileType dts nnoremap <C-T> :w <CR> :!dtc -O dtb -o %:r.dtb %:r.dts <CR>
map <C-s> :set spell!<CR>
nnoremap <esc> :noh<CR>
nnoremap <C-f> :NERDTreeToggle <CR>
nnoremap <C-u> :UndotreeToggle <CR>
nnoremap <F2> :Files ~/<CR>
nnoremap <F3> :e ~/.config/nvim/init.vim<CR>
""Move selected lines up or down
xnoremap <C-Up> :move '<-2<CR>gv-gv
xnoremap <C-Down> :move '>+1<CR>gv-gv
" Fold comments
nnoremap <C-1> :set foldmethod=expr foldexpr=getline(v:lnum)=~'^\\s*'.&commentstring[0] <CR>
filetype plugin on
let g:airline#parts#ffenc#skip_expected_string='utf-8[unix]'
let g:rustfmt_autosave = 1
colorscheme gruvbox
set background=dark