neovim stuffs
This commit is contained in:
parent
ce71de8abd
commit
5ffe274abd
@ -1,4 +1,7 @@
|
|||||||
|
|
||||||
|
" Syntax highlighting
|
||||||
|
syntax on
|
||||||
|
|
||||||
" Enable mouse usage
|
" Enable mouse usage
|
||||||
set mouse=a
|
set mouse=a
|
||||||
|
|
||||||
@ -7,6 +10,16 @@ set tabstop=4
|
|||||||
set shiftwidth=4
|
set shiftwidth=4
|
||||||
set expandtab
|
set expandtab
|
||||||
|
|
||||||
|
" VSCode-style selection indenting
|
||||||
|
nnoremap <Tab> >>_
|
||||||
|
nnoremap <S-Tab> <<_
|
||||||
|
inoremap <S-Tab> <C-D>
|
||||||
|
vnoremap <Tab> >gv
|
||||||
|
vnoremap <S-Tab> <gv
|
||||||
|
|
||||||
|
" VSCode-style shift-arrow for selection
|
||||||
|
set keymodel=startsel,stopsel
|
||||||
|
|
||||||
" Force VIM to use system clipboard
|
" Force VIM to use system clipboard
|
||||||
set clipboard=unnamedplus
|
set clipboard=unnamedplus
|
||||||
|
|
||||||
@ -14,12 +27,22 @@ set clipboard=unnamedplus
|
|||||||
set exrc
|
set exrc
|
||||||
set secure
|
set secure
|
||||||
|
|
||||||
|
" Autoload vim-plug
|
||||||
|
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
|
||||||
|
if empty(glob(data_dir . '/autoload/plug.vim'))
|
||||||
|
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||||
|
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
||||||
|
endif
|
||||||
|
|
||||||
" This is where the plugins be
|
" This is where the plugins be
|
||||||
call plug#begin()
|
call plug#begin()
|
||||||
|
|
||||||
Plug 'github/copilot.vim'
|
Plug 'github/copilot.vim'
|
||||||
Plug 'tpope/vim-fugitive'
|
Plug 'tpope/vim-fugitive'
|
||||||
Plug 'tpope/vim-surround'
|
Plug 'tpope/vim-surround'
|
||||||
|
Plug 'jiangmiao/auto-pairs'
|
||||||
|
Plug 'airblade/vim-gitgutter'
|
||||||
|
Plug 'nathanaelkane/vim-indent-guides'
|
||||||
|
|
||||||
" And this is where the plugins no longer be
|
" And this is where the plugins no longer be
|
||||||
call plug#end()
|
call plug#end()
|
||||||
@ -30,4 +53,11 @@ filetype plugin on
|
|||||||
syntax on
|
syntax on
|
||||||
|
|
||||||
" Enable rainbow
|
" Enable rainbow
|
||||||
let g:rainbow_active = 1
|
let g:rainbow_active = 1
|
||||||
|
|
||||||
|
" Allow indent guides to show
|
||||||
|
let g:indent_guides_enable_on_vim_startup = 0
|
||||||
|
let g:indent_guides_guide_size = 1
|
||||||
|
let g:indent_guides_auto_colors = 0
|
||||||
|
hi IndentGuidesOdd ctermbg=darkgrey
|
||||||
|
hi IndentGuidesEven ctermbg=lightgrey
|
@ -28,7 +28,7 @@ def main() -> int:
|
|||||||
print("File not found", file=sys.stderr)
|
print("File not found", file=sys.stderr)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# Compres the image to a temporary file
|
# Compress the image to a temporary file
|
||||||
with tempfile.NamedTemporaryFile(suffix=image_path.suffix) as temp:
|
with tempfile.NamedTemporaryFile(suffix=image_path.suffix) as temp:
|
||||||
# Compress
|
# Compress
|
||||||
if not args.no_compress:
|
if not args.no_compress:
|
||||||
|
@ -7,6 +7,7 @@ alias cls=clear
|
|||||||
alias p4='ping 8.8.8.8 -c 4'
|
alias p4='ping 8.8.8.8 -c 4'
|
||||||
alias quickhttp='sudo python -m SimpleHTTPServer 443'
|
alias quickhttp='sudo python -m SimpleHTTPServer 443'
|
||||||
alias zshreload="source ~/.zshrc"
|
alias zshreload="source ~/.zshrc"
|
||||||
|
alias wg-easykeys="wg genkey | tee >(wg pubkey)"
|
||||||
|
|
||||||
# Kill via pgrep
|
# Kill via pgrep
|
||||||
nkill() {
|
nkill() {
|
||||||
@ -22,6 +23,13 @@ mkcd() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Sources a .env
|
||||||
|
source_env() {
|
||||||
|
env=${1:-.env}
|
||||||
|
[ ! -f "${env}" ] && { echo "Env file ${env} doesn't exist"; return 1; }
|
||||||
|
eval $(sed -e '/^\s*$/d' -e '/^\s*#/d' -e 's/=/="/' -e 's/$/"/' -e 's/^/export /' "${env}")
|
||||||
|
}
|
||||||
|
|
||||||
# Auto-extract anything
|
# Auto-extract anything
|
||||||
extract() {
|
extract() {
|
||||||
if [ -f $1 ]; then
|
if [ -f $1 ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user