-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprivate_dot_vimrc
More file actions
125 lines (120 loc) · 3.29 KB
/
private_dot_vimrc
File metadata and controls
125 lines (120 loc) · 3.29 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
" VIM config by ANKDDEV
" https://github.com/ankddev/dotfiles
" Determine the data directory for vim-plug installation
if has('nvim')
let s:data_dir = stdpath('data')
else
if has('win32') || has('win64')
" On Windows Vim, use $HOME/vimfiles as data directory
let s:data_dir = expand('$HOME') . '\vimfiles'
else
" On Unix-like Vim, use ~/.vim
let s:data_dir = expand('~/.vim')
endif
endif
let s:plug_path = s:data_dir . '/autoload/plug.vim'
" Install vim-plug if not installed
if empty(glob(s:plug_path))
" Use curl to download plug.vim, create directories if needed
silent execute '!curl -fLo ' . shellescape(s:plug_path) . ' --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
" Run PlugInstall once after Vim starts
autocmd VimEnter * ++once PlugInstall | source $MYVIMRC
endif
" Set langauge to english
if has('unix')
language messages C
else
language messages en
endif
" Space settings
set expandtab
set smarttab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set autoindent
" Show line numbers
set relativenumber number
" Highlight current line
set cursorline
" Enable syntax highlighting
syntax on
" Disable Vi compatibility
set nocompatible
" Show partial command you type in the last line of the screen.
set showcmd
" Show matching words during a search.
set showmatch
" Use highlighting when doing a search.
set hlsearch
set incsearch
set ignorecase
set smartcase
set showmatch
" Allow hidden buffers
set hidden
" Clipboard control
set clipboard=unnamed,unnamedplus
" Completion
set wildmenu
set wildmode=list:longest
set wildignore=.docx,.jpg,.png,.gif,.pdf,.pyc,.exe,.flv,.img,.xlsx
set nu
set ruler
" Visual mode pressing * or # searches for the current selection
vnoremap <silent> * :<C-u>call VisualSelection('', '')<CR>/<C-R>=@/<CR><CR>
vnoremap <silent> # :<C-u>call VisualSelection('', '')<CR>?<C-R>=@/<CR><CR>
" Don't redraw while executing macros (good performance config)
set lazyredraw
" Set to auto read when a file is changed from the outside
set autoread
au FocusGained,BufEnter * silent! checktime
" Confirm before closing file with unsaved changes
set confirm
" Undo
set undofile
set undodir=~/.temp
" Save all buffers when Vim loses focus
au FocusLost * silent! wa
" Set the commands to save in history default number is 20.
set history=1000
" Enable filetype checking
filetype on
filetype plugin indent on
" Backspace setting
set backspace=indent,eol,start
set whichwrap+=<,>,[,]
" No wrap
set nowrap
" Disable bells
set noerrorbells
set novisualbell
" enable mouse support
set mouse=a
" Highlight 110 collumn
set colorcolumn=110
" Enable more colors
set termguicolors
" Plugins via https://github.com/junegunn/vim-plug
call plug#begin()
" Catppuccin theme
Plug 'catppuccin/vim', { 'as': 'catppuccin' }
" Language support
Plug 'sheerun/vim-polyglot'
" Justfule support
Plug 'NoahTheDuke/vim-just'
" Airline
Plug 'vim-airline/vim-airline'
let g:airline_powerline_fonts = 1
" Wakatime
Plug 'wakatime/vim-wakatime'
call plug#end()
" Apply theme
silent! colorscheme catppuccin_mocha
" You can split a window into sections by typing `:split` or `:vsplit`.
" Display cursorline and cursorcolumn ONLY in active window.
augroup cursor_off
autocmd!
autocmd WinLeave * set nocursorline
autocmd WinEnter * set cursorline
augroup END