-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
116 lines (85 loc) · 2.58 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
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
"
" NVIM RC
"
" Author: Rohan Chacko
"
"
" Load Vim-Plug and plugins
"
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-fugitive'
Plug 'scrooloose/nerdtree'
Plug 'airblade/vim-gitgutter'
Plug 'plasticboy/vim-markdown'
Plug 'godlygeek/tabular'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'arcticicestudio/nord-vim'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'hrsh7th/vim-vsnip'
Plug 'hrsh7th/vim-vsnip-integ'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.0' }
" LSP Support
Plug 'neovim/nvim-lspconfig'
Plug 'williamboman/mason.nvim', { 'branch': 'main' }
Plug 'williamboman/mason-lspconfig.nvim', { 'branch': 'main' }
" Autocomplete
Plug 'hrsh7th/nvim-cmp', { 'branch': 'main' }
Plug 'hrsh7th/cmp-buffer', { 'branch': 'main' }
Plug 'hrsh7th/cmp-path', { 'branch': 'main' }
Plug 'saadparwaiz1/cmp_luasnip'
Plug 'hrsh7th/cmp-nvim-lsp', { 'branch': 'main' }
Plug 'hrsh7th/cmp-nvim-lua', { 'branch': 'main' }
" Snippets
Plug 'L3MON4D3/LuaSnip'
Plug 'rafamadriz/friendly-snippets', { 'branch': 'main' }
Plug 'VonHeikemen/lsp-zero.nvim', { 'branch': 'main' }
call plug#end()
" Set leader key
let mapleader=" "
luafile ~/dotfiles/nvim/lua/lsp.lua
luafile ~/dotfiles/nvim/lua/nerdtree.lua
luafile ~/dotfiles/nvim/lua/telescope.lua
" Google style guides python
source ~/dotfiles/nvim/google_python_style.vim
"
" Theme Settings
"
" Enable truecolor terminal
set termguicolors
" Set colorscheme to nord
colorscheme nord
" Activate nord airline theme
let g:airline_theme='nord'
" Set line numbering
set number relativenumber
highlight LineNr guifg=#707b91 term=bold cterm=NONE ctermfg=Yellow ctermbg=NONE gui=NONE guibg=NONE
" Highlight screen column of cursor
set cursorline
" Clear screen column highlight
highlight clear cursorline
" Highlight cursor line number
highlight CursorLineNr guifg=bold
" Warp long lines
set wrap
" Ignore case when searching
set ignorecase
" Use uppercase if search string has uppercase
set smartcase
" Enable scrolling in tmux
set mouse=a
" Enable vim scrolling without cursor moving
" set so=999
" Press the j 2 times in row to switch to normal mode
inoremap jj <esc>
" Disable arrow keys in normal mode
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>
" Set number system to decimal -- treat numbers with leading zero as decimal
" instead of default octal
set nrformats=
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif