summaryrefslogtreecommitdiff
path: root/nvim/init.vim
blob: 0aa9c34974321fac6c55b347589c535eaa3b6638 (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
set nocompatible

" vim-plugged
call plug#begin()
	Plug 'itchyny/lightline.vim'
	Plug 'junegunn/goyo.vim'
    Plug 'mattn/emmet-vim'
    Plug 'neoclide/coc.nvim', {'branch': 'release'}
    Plug 'preservim/nerdtree'
    Plug 'ryanoasis/vim-devicons'
    Plug 'bluz71/vim-nightfly-guicolors'
    Plug 'morhetz/gruvbox'
    Plug 'dylanaraps/wal.vim'
call plug#end()

" Lightline Integration
    let g:lightline = {'colorscheme': 'nightfly'}

" General
    set laststatus=2
    set encoding=UTF-8
    set bg=dark
    syntax on 
    set nohlsearch
    set cursorline
    set incsearch
    set clipboard=unnamedplus
    set tabstop=4
    set softtabstop=4
    set shiftwidth=4
    set expandtab
    set autoindent
    set fileformat=unix
    set number
    set relativenumber
    set nowrap
    set noswapfile
    set noshowmode
    set incsearch 
    set scrolloff=8 

colorscheme wal 

" Autoload 
augroup remember_folds
  autocmd!
  autocmd BufWinLeave * mkview
  autocmd BufWinEnter * silent! loadview
augroup END


" Keymaps 
    let mapleader = " "
    vnoremap <C-c> "+y
    map <C-p> "+P
    let g:user_emmet_leader_key=','
    map <leader>h :wincmd h<CR>
    map <leader>j :wincmd j<CR>
    map <leader>k :wincmd k<CR>
    map <leader>l :wincmd l<CR>
    nnoremap <leader>nt :NERDTreeToggle %:p:h<CR>

" NERDTree
    map <F2> :NERDTreeToggle<CR>
    nnoremap <leader>nt :NERDTree %:p:h<CR>

" Goyo
    nnoremap <leader>g :Goyo<CR>

function! s:goyo_enter()
    set linebreak
    set spell spelllang=en_us
    HexokinaseTurnOff
endfunction

function! s:goyo_leave()
    set nolinebreak
    set nolinebreak 
    HexokinaseTurnOn
endfunction

" CoC
" Tab navigation and confirmation
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" Tab autocompletion
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"

" Remove Whitespaces After Closing File
autocmd BufWritePre *.sh :%s/\s\+$//e