-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
110 lines (91 loc) · 3.62 KB
/
Copy pathinit.vim
File metadata and controls
110 lines (91 loc) · 3.62 KB
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
" init.vim
" Specify a directory for plugins
call plug#begin('~/.config/nvim/plugged')
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
" Create a JSX function abbreviation
iabbrev jsxfunc export default function <C-R>=JsxFunc()<CR>
inoreabbrev modstyle className={style<C-R>=ModStyle()<CR>
iabbrev lorem Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur
" iabbrev html <html><C-Enter> <head><C-Enter></head><C-Enter><body><C-Enter></body><C-Enter></html>
iabbrev contenttype 'Content-Type': 'application/json'
iabbrev authfail new Response(null, { status: 401 });
iabbrev normfail new Response(null, { status: 400 });
iabbrev okresp new Response(null, { status: 200 });
command! Vter vsplit | terminal
tnoremap <Esc> <C-\><C-n>
nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>l :split \| ter bash -c 'git log -p; read'<cr>
nnoremap <leader>d :split \| ter bash -c 'git diff; read'<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
nnoremap <silent> <leader>sa :let @/ = '\<' . expand('<cword>') . '\>'<CR>:set hlsearch<CR>
nnoremap <leader>ya gg "*yG
nnoremap <silent> <leader>ss <CR>:set nohlsearch<CR>
nnoremap <silent> <LEFT> :vertical resize -2 <CR>
nnoremap <silent> <RIGHT> :vertical resize +2 <CR>
nnoremap <silent> <UP> :resize -2 <CR>
nnoremap <silent> <DOWN> :resize +2 <CR>
inoremap <LEFT> <Nop>
inoremap <RIGHT> <Nop>
nnoremap <Leader>c 0i//<Esc>
function! JsxFunc()
let funcname = input("Function name: ")
return funcname . '() {}'
endfunction
function! ModStyle()
let style = input("Class name: ")
return style.'}'
endfunction
" Treat _ and - as white space
" set iskeyword-=-
" set iskeyword-=_
" Set tab size to 4 spaces
set tabstop=2
" Set indentation width to 4 spaces
set shiftwidth=2
" Use spaces instead of tabs for indentation
set expandtab
set path+=.,src/**
set relativenumber
set number
set nohlsearch
"Prettier
Plug 'maxmellon/vim-jsx-pretty'
"Handlebars
Plug 'mustache/vim-mustache-handlebars'
"Shows tab numbers, very useful
Plug 'sangdol/mintabline.vim'
"for fzf
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.6' }
"autocomplete
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'neovim/nvim-lspconfig'
Plug 'pangloss/vim-javascript'
"themes to play around with
Plug 'folke/tokyonight.nvim'
Plug 'sainnhe/everforest'
Plug 'diegoulloao/neofusion.nvim'
Plug 'shaunsingh/solarized.nvim'
Plug 'rebelot/kanagawa.nvim'
Plug 'tjdevries/colorbuddy.nvim'
Plug 'morhetz/gruvbox'
" Configure stylelint-lsp language server
" au User lsp_setup call lspconfig#stylelint#setup({})
" Initialize plugin system
call plug#end()
set guicursor=n-v-c-i:block
set termguicolors
" set background=light
" colorscheme kanagawa-wave " chill
" colorscheme kanagawa-lotus " light
" colorscheme kanagawa-dragon " dark
" colorscheme tokyonight
" colorscheme neofusion
" colorscheme colorbuddy
colorscheme gruvbox
autocmd FileType javascript setl formatprg=eslint\ --stdin\ --stdin-filename\=%\ --fix\|%s/\s\+$//e
autocmd FileType typescript setl formatprg=eslint\ --stdin\ --stdin-filename\=%\ --fix\|%s/\s\+$//e
autocmd FileType typescriptreact setl formatprg=eslint\ --stdin\ --stdin-filename\=%\ --fix\|%s/\s\+$//e
autocmd FileType html setl formatprg= eslint\ --stdin\ --stdin-filename\=%\ --fix\|%s/\s\+%//e