This repository was archived by the owner on Nov 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
79 lines (74 loc) · 2.83 KB
/
init.vim
File metadata and controls
79 lines (74 loc) · 2.83 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
" # Vim and Neovim configuration file.
" # Copyright 2024-2025. Pratik Mullick.
" DEFAULT OPTIONS **Common for Vim, GVim, and Neovim**
" Run in secure mode with UTF-8 support.
set secure
set encoding=utf-8
" Enable Syntax Hightlighting.
syntax on
" By default, line numbers enabled and wrapping disabled.
set number
set nowrap
" Disable creating of backup and undo files.
set nobackup
set nowritebackup
set noswapfile
set noundofile
" Automatically detect file type.
filetype plugin indent on
" Set highlighting color in both terminal and GUI.
highlight Visual cterm=reverse gui=reverse
" Set word wrap column color.
highlight ColorColumn ctermbg=2
" Set splits to the right and bottom always
set splitbelow splitright
" Disable bells and pings
set noerrorbells visualbell t_vb=
" Detect file changes
set autoread
" # FileType Options
augroup my_files
" Document Files
" ## Plaintext, markdown and LaTeX
autocmd FileType text,markdown,tex setlocal autoindent expandtab |
\ setlocal tabstop=2 softtabstop=2 shiftwidth=2 cc=80 tw=79 |
\ setlocal wrap linebreak spell nonumber |
\ setlocal omnifunc= |
\ setlocal completefunc= |
\ let g:tex_flavor='latex'
autocmd FileType markdown,tex let b:completion_suppressed = 1
autocmd FileType markdown,tex let b:coc_suggest_disable = 1
autocmd FileType markdown,tex let b:completion_disable_auto_complete = 1
" ## JSON / JSONC (JSON with Comments)
autocmd FileType json,jsonc setlocal autoindent expandtab |
\ setlocal tabstop=4 softtabstop=4 shiftwidth=4
autocmd FileType json,jsonc let b:completion_suppressed = 1
autocmd FileType json,jsonc let b:coc_suggest_disable = 1
" ## HTML and XML
autocmd FileType html,xml setlocal autoindent expandtab |
\ setlocal tabstop=4 softtabstop=4 shiftwidth=4
autocmd FileType html,xml let b:completion_suppressed = 1
autocmd FileType html,xml let b:coc_suggest_disable = 1
" ## CSS
autocmd FileType css setlocal autoindent expandtab |
\ setlocal tabstop=4 softtabstop=4 shiftwidth=4
" Code Files
" ## Python
autocmd FileType python syn keyword pythonSelf self |
\ highlight def link pythonSelf Special |
\ setlocal autoindent expandtab tabstop=4 softtabstop=4 shiftwidth=4
" ## JavaScript and React
autocmd FileType javascript,javascriptreact syn keyword javaScriptOf of |
\ highlight def link javaScriptOf Repeat |
\ setlocal autoindent expandtab tabstop=4 softtabstop=4 shiftwidth=4
" ## C / C++
autocmd FileType c,cpp,h setlocal autoindent expandtab |
\ setlocal tabstop=4 shiftwidth=4
" Script Files
" ## Shell, PowerShell, and Vim Config
autocmd FileType vim,sh,ps1 setlocal autoindent expandtab |
\ setlocal softtabstop=4 shiftwidth=4
augroup END
if has('nvim')
lua require('init')
endif