Added Screenshot script for i3, fixed writeup path for ranger, added aws centos to ssh, added some abbrevs for *.go in vim, added metasploit alias to .zshrc~

This commit is contained in:
TuDatTr
2020-05-13 05:20:44 +02:00
parent b19a19751f
commit 68b7df6495
13 changed files with 61 additions and 49 deletions

View File

@@ -3,14 +3,17 @@ set autoindent noexpandtab tabstop=4 shiftwidth=4
" Shortcuts
abbrev funct func Test(t *testing.T) {<CR>}<Esc>kwwi
abbrev trun t.Run("", func(t *testing.T) {<CR>})<Esc>%la
abbrev terr t.Errorf("got %d, want %d", got, want)
abbrev fori for i := 0; i < ; i++{<CR>}<Esc>k2f;i
abbrev terr t.Errorf("got %v, want %v", got, want)<Esc>02f,lcaw
abbrev thelp func(t *testing.T) {<CR>t.Helper()<CR>}<Esc>ko
abbrev fori for i := 0; i <; i++{<CR>}<Esc>k2f;i
abbrev fore for i, c := range{<CR>}<Esc>kf{i
" Compiling
nnoremap <C-c><C-f> <Esc>:GoFmt<CR>
nnoremap <C-c><C-c> <Esc>:!clear<CR><CR>:GoRun<CR>
nnoremap <C-c><C-b> <CR>:GoBuild<CR>
nnoremap <C-c><C-t> <CR>:GoTest<CR>
nnoremap <F9> <CR>:GoImports<CR>
nnoremap <C-c><C-d> <CR>:GoDebugStart<CR>
nnoremap gd <Esc>:GoDef
nnoremap <F1> <Esc>:GoDoc<CR>

View File

@@ -3,7 +3,6 @@ syntax on
filetype indent plugin on
set background=light
set encoding=utf-8
set autowrite
set smartcase
set incsearch
set hlsearch

View File

@@ -0,0 +1,2 @@
autocmd BufNewFile,BufRead *.razor setf html

View File

@@ -1,33 +0,0 @@
" This callback will be executed when the entire command is completed
function! BackgroundCommandClose(channel)
" Read the output from the command into the quickfix window
unlet g:backgroundCommandOutput
endfunction
function! RunBackgroundCommand(command)
" Make sure we're running VIM version 8 or higher.
if v:version < 800
echoerr 'RunBackgroundCommand requires VIM version 8 or higher'
return
endif
if exists('g:backgroundCommandOutput')
echo 'Already running task in background'
else
echo 'Running task in background'
" Launch the job.
" Notice that we're only capturing out, and not err here. This is because, for some reason, the callback
" will not actually get hit if we write err out to the same file. Not sure if I'm doing this wrong or?
let g:backgroundCommandOutput = tempname()
call job_start(a:command, {'close_cb': 'BackgroundCommandClose', 'out_io': 'file', 'out_name': g:backgroundCommandOutput})
endif
endfunction
" So we can use :BackgroundCommand to call our function.
command! -nargs=+ -complete=shellcmd RunBackgroundCommand call RunBackgroundCommand(<q-args>)
function! GetCWD()
let l:cwd = system('pwd | rev |cut -d- -f1 | rev | xargs | sed "s/[[:space:]]/\\\\&/g\"')
echo l:cwd
call setline('.', l:cwd)
unlet l:cwd
endfunction

View File

@@ -14,3 +14,4 @@ let g:polyglot_disabled = ['latex']
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"

View File

@@ -3,3 +3,5 @@
author: Tuan-Dat Tran
date: [:VIM_EVAL:]strftime('%Y-%m-%d')[:END_EVAL:]
...
# [:VIM_EVAL:]system ("basename $(pwd)")[:END_EVAL:]