|
1 | 1 | " nvim file: ~/.config/nvim/init.vim |
2 | | -" Last Change: 2018 mar 17 18:40 |
| 2 | +" Last Change: 2018 mar 17 20:36 |
3 | 3 | " vim: ff=unix ai et ts=4 |
4 | 4 | " Author: Sérgio Luiz Araújo Silva |
5 | 5 | " Reference: http://sergioaraujo.pbworks.com/w/page/15864094/vimrc |
@@ -723,13 +723,6 @@ nnoremap <F3> :CountWord<CR> |
723 | 723 | " nnoremap <silent> <Leader>o :<C-u>call append(line("."), repeat([""], v:count1))<CR> |
724 | 724 | " nnoremap <silent> <Leader>O :<C-u>call append(line(".")-1, repeat([""], v:count1))<CR> |
725 | 725 |
|
726 | | -" https://vi.stackexchange.com/a/7278/7339 |
727 | | -" https://superuser.com/a/147842/45032 |
728 | | -" Insert new line above and below in normal mode |
729 | | -" unimpaired [<space ]<space> |
730 | | -nnoremap <CR> :call append(line('.'), '')<CR> |
731 | | -nnoremap <A-CR> :call append(line('.')-1, '')<CR> |
732 | | -
|
733 | 726 | " Autocmd Rules ********************************** |
734 | 727 |
|
735 | 728 | "colorscheme ayu |
@@ -939,13 +932,44 @@ nnoremap <C-k> _D |
939 | 932 | " https://vi.stackexchange.com/a/8368/7339 |
940 | 933 | function! DeleteAbove() |
941 | 934 | if getline(".") =~ "^$" |
942 | | - exec 'normal! kdd' |
| 935 | + exec 'normal! kdd0' |
943 | 936 | else |
944 | 937 | exec 'normal! d0dgk"-Pl' |
945 | 938 | endif |
946 | 939 | endfunction |
947 | 940 | nnoremap <Leader>k :call DeleteAbove()<CR> |
948 | 941 |
|
| 942 | +" https://vi.stackexchange.com/a/4171/7339 |
| 943 | +"function! DeleteOver() |
| 944 | +" let save_cursor = getpos(".") |
| 945 | +" normal k |
| 946 | +" normal dd |
| 947 | +" call setpos(".", save_cursor) |
| 948 | +" normal k |
| 949 | +"endfunction |
| 950 | +"nnoremap <Leader>k :call DeleteOver()<CR> |
| 951 | + |
| 952 | +function! DeleteUnder() |
| 953 | + let save_cursor = getpos(".") |
| 954 | + normal j |
| 955 | + normal dd |
| 956 | + call setpos(".", save_cursor) |
| 957 | +endfunction |
| 958 | +nnoremap <Backspace> :call DeleteUnder()<CR> |
| 959 | +
|
| 960 | +" https://vi.stackexchange.com/a/7278/7339 |
| 961 | +" https://superuser.com/a/147842/45032 |
| 962 | +" Insert new line above and below in normal mode |
| 963 | +" unimpaired [<space ]<space> |
| 964 | +nnoremap <CR> :call append(line('.'), '')<CR> |
| 965 | +nnoremap <A-CR> :call append(line('.')-1, '')<CR> |
| 966 | +
|
| 967 | +" Here we have some shortcuts (above) |
| 968 | +" <CR> ............... add new line below in normal mode |
| 969 | +" <A-CR> ............. add new line above in normal mode |
| 970 | +" <Leader>k .......... removes line above in normal mode |
| 971 | +" <Backspace> ........ removes line below in normal mode |
| 972 | + |
949 | 973 | " Make Ctrl-e jump to the end of the current line in the |
950 | 974 | " insert mode. This is handy when you are in the middle of |
951 | 975 | " a line and would like to go to its end without switching |
|
0 commit comments