forked from danelsarg81/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
91 lines (74 loc) · 2.27 KB
/
.vimrc
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
set number relativenumber
syntax on && syntax enable
set colorcolumn=80
autocmd FileType * set colorcolumn=80
" Remap Esc in INSERT mode
inore kj <Esc>
inore KJ <Esc>
" Enable mouse motions
set mouse=a
" Indentation
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set autoindent
set smartindent
filetype plugin indent on
" Searching
set hlsearch
set incsearch
set ignorecase
" Fun with <leader>
let mapleader = ' '
nnoremap <leader>pv :execute ":Explore"<CR>
nnoremap <leader>gs :execute ":!git status"<CR>
nnoremap <leader>cc :execute 'set colorcolumn=' . (&colorcolumn == "" ? "80" : "")<CR>
" Use :RandomColorscheme on startup
function! SetRandomColorscheme()
let schemes = getcompletion('', 'color')
let random_scheme = schemes[rand() % len(schemes)]
execute 'colorscheme ' . random_scheme
echo "Selected colorscheme: " . random_scheme " WON'T WORK!
endfunction
command! RandomColorscheme call SetRandomColorscheme()
autocmd VimEnter * call SetRandomColorscheme()
" Increment the number under the cursor
function! IncrementNumber()
execute 'normal \<C-a>'
endfunction
" -------------- INOP --------------
" let my_colorschemes = ['delek', 'slate', 'pablo' , 'zellner', 'elflord']
" execute 'colorscheme' my_colorschemes[rand() % (len(my_colorschemes) - 1 ) ]
" Disable arrow-keys -- not during INSERT
"map <Left> <NOP>
"map <Down> <NOP>
"map <Up> <NOP>
"map <Right> <NOP>
" Generate matching punctuation
"inoremap " ""<left>
"inoremap ' ''<left>
"inoremap ( ()<left>
"inoremap [ []<left>
"inoremap { {}<left>
"inoremap {<CR> {<CR>}<ESC>O
"inoremap {;<CR> {<CR>};<ESC>O
" Statusline
"set laststatus=2
"set statusline=
"set statusline=%F " Path to the file
"set statusline+=%= " Switch to the right side
"set statusline+=%l " Current line
"set statusline+=/ " Separator
"set statusline+=%L " Total lines
" Git for statusline
"function! GitBranch()
" return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
"endfunction
"
"function! StatuslineGit()
" let l:branchname = GitBranch()
" return strlen(l:branchname) > 0?' '.l:branchname.' ':''
"endfunction
"
" set statusline+=%{StatuslineGit()}