-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
181 lines (152 loc) · 6.02 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
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
" Universal Config file
:lua require('patch')
let mapleader = "," " map leader to comma
set splitright
set nocompatible " disable compatibility to old-time vi
set showmatch " show matching
set ignorecase " case insensitive
set hlsearch " highlight search
set incsearch " incremental search
set tabstop=4 " number of columns occupied by a tab
set softtabstop=4 " see multiple spaces as tabstops so <BS> does the right thing
set expandtab " converts tabs to white space
set shiftwidth=4 " width for autoindents
"set autoindent " indent a new line the same amount as the line just typed
set number " add line numbers
set wildmode=longest,list " get bash-like tab completions
filetype plugin indent on "allow auto-indenting depending on file type
set clipboard=unnamedplus " using system clipboard
filetype plugin on
set cursorline " highlight current cursorline
set ttyfast " Speed up scrolling in Vim
set spell " enable spell check (may need to download language package)
set noswapfile " disable creating swap file
set backupdir=~/.cache/vim " Directory to store backup files.
set encoding=UTF-8 " Encoding for devicons
set relativenumber
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows
if !exists('g:syntax_on')
syntax enable
endif
nnoremap <Leader>o :wincmd p<Enter> " move cursor to other window
nnoremap <Leader>w :write %<Enter>
nnoremap <Leader>so :source %<Enter>
nnoremap <Leader>ns :nohlsearch<Enter> " disable highlighting of search
nnoremap <Leader>tw :tabnew<Enter> " disable highlighting of search
nnoremap <Leader>tn :tabnext<Enter> " disable highlighting of search
nnoremap <Leader>tp :tabprevious<Enter> " disable highlighting of search
nnoremap <Leader>tc :tabclose<Enter> " disable highlighting of search
nnoremap <Leader>vs :split<bar> :wincmd p <bar> :resize 8 <bar> :terminal<Enter>
nnoremap <Leader>bd :b#<Enter> " delete current buffer and replace it with previous buffer
nnoremap <Leader>lu :m .-1<CR>==
nnoremap <Leader>ld :m .+1<CR>==
nnoremap <leader>sw ddkP<CR>
nnoremap <leader>sc Lzt<CR>
" Haskell config
" formatting on save
autocmd FileType haskell autocmd BufWritePre <buffer> call CocAction('format')
" Map switching windows to <M-h> and <M-l> and <M-j> and <M-k>
nnoremap <M-h> <C-w>h
nnoremap <M-l> <C-w>l
nnoremap <M-j> <C-w>j
nnoremap <M-k> <C-w>k
let g:editorconfig = v:true
let g:ctrlp_custom_ignore = 'node_modules\|\v[\/]\.(git|hg|svn)$'
let g:ctrlp_custom_ignore = {
\ 'dir': 'node_modules\|\v[\/]\.(git|hg|svn)$',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': 'some_bad_symbolic_links',
\ }
" set colorscheme to night owl
"colorscheme night-owl
"let g:night_owl_terminal_colors = 1
"let g:night_owl_italic_comments = 1
"let g:night_owl_italic_keywords = 1
"let g:night_owl_italic_functions = 1
"let g:night_owl_italic_variables = 1
"let g:night_owl_contrast = "hard"
"let g:night_owl_borders = 1
"let g:night_owl_disable_background = 1
"let g:night_owl_terminal_italics = 1
"let g:night_owl_terminal_bold = 1
"colorscheme night-owl
colorscheme catppuccin-latte " catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha
":lua require('noirbuddy').setup({ preset = 'miami-nights'})
call plug#begin('~/.vim/plugged')
" Plugin Section
Plug 'ctrlpvim/ctrlp.vim'
Plug 'scrooloose/nerdtree'
Plug 'hachy/eva01.vim', { 'branch': 'main' }
Plug 'itchyny/lightline.vim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'tpope/vim-fugitive',
Plug 'github/copilot.vim',
Plug 'yaegassy/coc-volar-tools', {'do': 'yarn install --frozen-lockfile'},
Plug 'MunifTanjim/nui.nvim',
Plug 'ThePrimeagen/vim-be-good',
Plug 'ryanoasis/vim-devicons',
Plug 'ray-x/aurora',
Plug 'goerz/jupytext.vim',
Plug 'mattn/emmet-vim',
Plug 'alvan/vim-closetag',
Plug 'oxfist/night-owl.nvim'
Plug 'chrisbra/csv.vim',
Plug 'catppuccin/nvim', { 'as': 'catppuccin' },
call plug#end()
" Configuration on plugins
"set background=dark
"\ 'colorscheme': 'darcula',
let g:lightline = {
\ 'colorscheme': 'selenized_light',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'cocstatus': 'coc#status',
\ 'cocprogress': 'coc#progress',
\ 'gitbranch': 'FugitiveHead',
\ },
\ }
" Neovim terminal configuration
if has('nvim')
tnoremap <leader><Esc> <C-\><C-n>
tnoremap <C-v><Esc> <Esc>
endif
" Start NERDTree and put the cursor back in the other window.
autocmd VimEnter * NERDTree | wincmd p
" 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
let NERDTreeShowBookmarks=1
let g:WebDevIconsNerdTreeGitPluginForceVAlign = 1
let g:WebDevIconsUnicodeDecorateFolderNodes = 1
nnoremap <Leader>nt :NERDTreeToggle<Enter>
nnoremap <Leader>nf :NERDTreeFind<Enter>
nnoremap <Leader>bs gg 2j<Enter>
" Find files using Telescope command-line sugar.
nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fc <cmd>Telescope coc<cr>
nnoremap <leader>fw <cmd>Telescope file_browser<cr>
nnoremap <leader>ft <cmd>Telescope<cr>
" Listchars configuration
set listchars=eol:↓,space:·,trail:●,tab:→⇥⇥,extends:>,precedes:<
" Sourcing configurations of plugins in vimscript
source ~/.config/nvim/vim/jupytext.vim
" Lua configuration and init of packer
" Uncomment when packer is configured and installed
:lua require('plugins')
" Coc Configuration
:lua require('coc-config')
" Treesitter configuration
:lua require('treesitter')
" Telescope helper
:lua require('helpers/helpers')
" Telescope configuration
:lua require('telescopeconfig')
" Iron configuration
:lua require('ironconfig')
" Gitsigns configuration
:lua require('gitsignsconfig')