Add git
This commit is contained in:
38
init.vim
38
init.vim
@@ -14,6 +14,7 @@ call plug#begin(stdpath('data') . '/plugged')
|
|||||||
Plug 'rafi/awesome-vim-colorschemes' " Provides a number of pretty themes
|
Plug 'rafi/awesome-vim-colorschemes' " Provides a number of pretty themes
|
||||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " Fast fuzzy file searching
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " Fast fuzzy file searching
|
||||||
Plug 'junegunn/fzf.vim'
|
Plug 'junegunn/fzf.vim'
|
||||||
|
Plug 'tpope/vim-fugitive' " Adds git support to vim
|
||||||
Plug 'tpope/vim-surround' " Adds motions for dealing with parentheses
|
Plug 'tpope/vim-surround' " Adds motions for dealing with parentheses
|
||||||
Plug 'tpope/vim-commentary' " Easily comment/uncomment lines with `gc`
|
Plug 'tpope/vim-commentary' " Easily comment/uncomment lines with `gc`
|
||||||
Plug 'tpope/vim-unimpaired' " A series of bindings for complementary actions [<space> and ]<space> for adding lines before and after
|
Plug 'tpope/vim-unimpaired' " A series of bindings for complementary actions [<space> and ]<space> for adding lines before and after
|
||||||
@@ -121,6 +122,8 @@ nnoremap <Leader>es :source $MYVIMRC<cr>
|
|||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
"Changing unused ctrl bindings
|
"Changing unused ctrl bindings
|
||||||
|
"Turn on git blame
|
||||||
|
nnoremap <c-s-a> <cmd>GBlame<cr>
|
||||||
"List all tags in the current buffer (replaced pageup, use CTRL-u instead)
|
"List all tags in the current buffer (replaced pageup, use CTRL-u instead)
|
||||||
nnoremap <c-b> <cmd>BTags<cr>
|
nnoremap <c-b> <cmd>BTags<cr>
|
||||||
"List all tags in directory
|
"List all tags in directory
|
||||||
@@ -131,17 +134,14 @@ nnoremap <c-e> <cmd>History<cr>
|
|||||||
nnoremap <c-f> /
|
nnoremap <c-f> /
|
||||||
"Search within the whole project
|
"Search within the whole project
|
||||||
nnoremap <c-s-f> <cmd>Rg<cr>
|
nnoremap <c-s-f> <cmd>Rg<cr>
|
||||||
"Search git history (replaced something weird with netrw)
|
|
||||||
nnoremap <c-h> <cmd>Commits<cr>
|
|
||||||
"Search git history within current buffer/selection
|
|
||||||
nnoremap <c-s-h> <cmd>BCommits<cr>
|
|
||||||
"Move line down (uses vim-unimpaired) (replaced move down, use "j")
|
"Move line down (uses vim-unimpaired) (replaced move down, use "j")
|
||||||
nnoremap <c-j> ]e
|
nnoremap <c-j> ddkP
|
||||||
"Move line up (uses vim-unimpaired) (replaced move up, use "k")
|
"Move line up (uses vim-unimpaired) (replaced move up, use "k")
|
||||||
nnoremap <c-k> [e
|
nnoremap <c-k> ddp
|
||||||
"Search marks (replaced move down, use <CR>)
|
"Does not work because of legacy reasons
|
||||||
nnoremap <c-m> <cmd>Marks<cr>
|
" nnoremap <c-m>
|
||||||
" nnoremap <c-n>
|
"Search marks (replaced "j" clone)
|
||||||
|
nnoremap <c-n> <cmd>Marks<cr>
|
||||||
"Search version controlled files (replaced move up, use "k")
|
"Search version controlled files (replaced move up, use "k")
|
||||||
nnoremap <c-p> <cmd>GFiles<cr>
|
nnoremap <c-p> <cmd>GFiles<cr>
|
||||||
"Search all files in directory
|
"Search all files in directory
|
||||||
@@ -155,6 +155,8 @@ nnoremap <c-y> <cmd>Commits<cr>
|
|||||||
"Search git history within current buffer/selection
|
"Search git history within current buffer/selection
|
||||||
nnoremap <c-s-y> <cmd>BCommits<cr>
|
nnoremap <c-s-y> <cmd>BCommits<cr>
|
||||||
|
|
||||||
|
"Turn on git blame
|
||||||
|
inoremap <c-s-a> <cmd>GBlame<cr>
|
||||||
"List all tags in the current buffer
|
"List all tags in the current buffer
|
||||||
inoremap <c-b> <cmd>BTags<cr>
|
inoremap <c-b> <cmd>BTags<cr>
|
||||||
"List all tags in directory
|
"List all tags in directory
|
||||||
@@ -165,16 +167,12 @@ inoremap <c-e> <cmd>History<cr>
|
|||||||
inoremap <c-f> <Esc>/
|
inoremap <c-f> <Esc>/
|
||||||
"Search within the whole project
|
"Search within the whole project
|
||||||
inoremap <c-s-f> <cmd>Rg<cr>
|
inoremap <c-s-f> <cmd>Rg<cr>
|
||||||
"Search git history (replaced backspace clone)
|
|
||||||
inoremap <c-h> <cmd>Commits<cr>
|
|
||||||
"Search git history within current buffer/selection
|
|
||||||
inoremap <c-s-h> <cmd>BCommits<cr>
|
|
||||||
"Move line down (uses vim-unimpaired) (replaced <CR> clone)
|
"Move line down (uses vim-unimpaired) (replaced <CR> clone)
|
||||||
inoremap <c-j> <Esc>]ei
|
inoremap <c-j> <Esc>ddkPi
|
||||||
"Move line up (uses vim-unimpaired) (replaced start digraph, use command instead)
|
"Move line up (uses vim-unimpaired) (replaced start digraph, use command instead)
|
||||||
inoremap <c-k> <Esc>[ei
|
inoremap <c-k> <Esc>ddpi
|
||||||
"Search marks (replaced <CR> clone)
|
"Does not work because of legacy reasons
|
||||||
inoremap <c-m> <cmd>Marks<cr>
|
" inoremap <c-m> <cmd>Marks<cr>
|
||||||
"Add line below (replaced execute single command in normal)
|
"Add line below (replaced execute single command in normal)
|
||||||
inoremap <c-o> <Esc>o
|
inoremap <c-o> <Esc>o
|
||||||
"Add line above
|
"Add line above
|
||||||
@@ -188,9 +186,9 @@ nnoremap <c-q> <cmd>CHADopen<cr>
|
|||||||
"Search all snippets (uses ultisnips)
|
"Search all snippets (uses ultisnips)
|
||||||
inoremap <c-s> <cmd>Snippets<cr>
|
inoremap <c-s> <cmd>Snippets<cr>
|
||||||
"Search git history (replaced inserting characters from above)
|
"Search git history (replaced inserting characters from above)
|
||||||
nnoremap <c-y> <cmd>Commits<cr>
|
inoremap <c-y> <cmd>Commits<cr>
|
||||||
"Search git history within current buffer/selection
|
"Search git history within current buffer/selection
|
||||||
nnoremap <c-s-y> <cmd>BCommits<cr>
|
inoremap <c-s-y> <cmd>BCommits<cr>
|
||||||
|
|
||||||
"Add simple highlight removal
|
"Add simple highlight removal
|
||||||
nnoremap <Leader><space> :nohlsearch<cr>
|
nnoremap <Leader><space> :nohlsearch<cr>
|
||||||
@@ -234,7 +232,7 @@ command! X execute 'silent! x !doas /usr/bin/tee % >/dev/null' <Bar> edit!
|
|||||||
|
|
||||||
" Plugins --- {{{
|
" Plugins --- {{{
|
||||||
|
|
||||||
" Toggle emmet completion useing <Tab> with <Leader>em
|
" Toggle emmet completion using <Tab> with <Leader>em
|
||||||
let g:emmet_completion = 0
|
let g:emmet_completion = 0
|
||||||
function ToggleEmmet()
|
function ToggleEmmet()
|
||||||
if g:emmet_completion
|
if g:emmet_completion
|
||||||
|
|||||||
Reference in New Issue
Block a user