-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
70 lines (59 loc) · 1.77 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
" ignore case when /searching
set ignorecase
" set number
syntax on
set ruler
set mouse=a
" Search as you type.
set incsearch
" things that clutter git
set nobackup
set noswapfile
" ident
set tabstop=4 shiftwidth=4 expandtab
" f10 to go to end of line (so you have 0 and F10)
nmap <F10> $
" clipboard ?
" http://vim.wikia.com/wiki/Accessing_the_system_clipboard
" ... to obtain clipboard support install the packages vim-gtk or vim-gnome
set clipboard=unnamedplus
" colores
" https://github.com/flazz/vim-colorschemes
colorscheme angr
" persistent undo
silent !mkdir -p "$HOME/.vim/undo"
set undofile
set undodir=$HOME/.vim/undo
set undolevels=1000
set undoreload=10000
" :Ex file manager sort order
let g:netrw_sort_by = "time"
let g:netrw_sort_direction = "reverse"
" fzf
" https://dev.to/pbnj/interactive-fuzzy-finding-in-vim-without-plugins-4kkj
" press <leader> + ff or type :Files to open fzf file search
let mapleader = "," " default leader is \
function! FZF() abort
let l:tempname = tempname()
" fzf | awk '{ print $1":1:0" }' > file
execute 'silent !fzf --multi ' . '| awk ''{ print $1":1:0" }'' > ' . fnameescape(l:tempname)
try
execute 'cfile ' . l:tempname
redraw!
finally
call delete(l:tempname)
endtry
endfunction
" :Files
command! -nargs=* Files call FZF()
" \ff
nnoremap <leader>ff :Files<cr>
" Move visually selected lines up or down in visual or normal mode (shift + k or j)
" https://www.youtube.com/watch?v=gNyNm5DsQ88
nnoremap K :m .-2<cr>==
nnoremap J :m .+1<cr>==
vnoremap K :m '<-2<cr>gv=gv
vnoremap J :m '>+1<cr>gv=gv
" from /etc/vim/vimrc
" Uncomment the following to have Vim jump to the last position when reopening a file
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif