zsh and nvim

This commit is contained in:
Flo
2023-02-01 13:25:23 +01:00
parent 6e93bc0868
commit 085b850d99
38 changed files with 943 additions and 0 deletions

12
.config/nvim/.netrwhist Normal file
View File

@ -0,0 +1,12 @@
let g:netrw_dirhistmax =10
let g:netrw_dirhistcnt =1
let g:netrw_dirhist_1='/home/brodie'
let g:netrw_dirhist_0='/home/brodie/.abduco'
let g:netrw_dirhist_9='/home/brodie/scripts/alsa'
let g:netrw_dirhist_8='/home/brodie/repos/bookmenu'
let g:netrw_dirhist_7='/home/brodie'
let g:netrw_dirhist_6='/home/brodie/.config/mpd'
let g:netrw_dirhist_5='/home/brodie'
let g:netrw_dirhist_4='/home/brodie/repos/dotfiles/config/nvim'
let g:netrw_dirhist_3='/home/brodie/repos/dotfiles/config/cointop'
let g:netrw_dirhist_2='/home/brodie'

View File

@ -0,0 +1,22 @@
"set termguicolors
colorscheme codedark
vmap < <gv
vmap > >gv
set showmatch " show matching
set ignorecase " case insensitive
set hlsearch " highlight search
set incsearch " incremental search
set tabstop=4 " number of columns occupied by a tab
set softtabstop=4 " see multiple spaces as tabstops so <BS> does the right thing
set expandtab " converts tabs to white space
set shiftwidth=4 " width for autoindents
" set autoindent " indent a new line the same amount as the line just typed
" set mouse=v " middle-click paste with
" set mouse=a " enable mouse click
" set clipboard=unnamedplus " using system clipboard
filetype plugin on
set cursorline " highlight current cursorline
set ttyfast " Speed up scrolling in Vim
" set spell " enable spell check (may need to download language package)
" set noswapfile " disable creating swap file
" set backupdir=~/.cache/vim " Directory to store backup files.

View File

@ -0,0 +1,74 @@
{
"pairs.enableCharacters": ["(", "[", "{", "'", "\"", "`"],
"suggest.noselect": false,
"coc.preferences.formatOnSaveFiletypes": [
"javascript",
"typescript",
"typescriptreact",
"json",
"javascriptreact",
"typescript.tsx",
"graphql"
],
"explorer.icon.enableNerdfont": true,
"explorer.quitOnOpen": true,
"explorer.position": "left",
"explorer.file.showHiddenFiles": true,
"explorer.file.column.clip.copy": "",
"explorer.file.column.clip.cut": "",
"explorer.keyMappings": {
"gk": "expandablePrev",
"gj": "expandableNext",
"<space>": "toggleSelection",
"<tab>": "actionMenu",
"h": "collapse",
"l": ["expandable?", "expand", "open"],
"J": ["toggleSelection", "nodeNext"],
"K": ["toggleSelection", "nodePrev"],
"<2-LeftMouse>": [
"expandable?",
["expanded?", "collapse", "expand"],
"open"
],
"o": ["expanded?", "collapse", "expand"],
"<cr>": ["expandable?", "cd", "open"],
"H": "open:split",
"S": "open:split:plain",
"V": "open:vsplit",
"<bs>": "gotoParent",
"Y": "copyFile",
"X": "cutFile",
"P": "pasteFile",
"dd": "delete",
"mf": "addFile",
"md": "addDirectory",
"r": "rename",
".": "toggleHidden",
"R": "refresh",
"?": "help",
"q": "quit",
"<esc>": "esc",
"!": "systemExecute",
"gd": "listDrive",
"f": "search",
"F": "searchRecursive",
"gf": "gotoSource:file",
"gb": "gotoSource:buffer",
"[[": "sourcePrev",
"]]": "sourceNext",
"gp": "gitPrev",
"gn": "gitNext",
"ga": "gitStage",
"gr": "gitUnstage"
}
}

View File

@ -0,0 +1,6 @@
" Fix tex file type set
autocmd BufRead,BufNewFile *.tex set filetype=tex
autocmd BufRead,BufNewFile *.md set filetype=markdown
autocmd BufRead,BufNewFile *.tp set filetype=type
autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown

View File

@ -0,0 +1 @@
setlocal spell spelllang=en_au

View File

@ -0,0 +1 @@
setlocal spell spelllang=en_au

View File

@ -0,0 +1 @@
setlocal spell spelllang=en_au

19
.config/nvim/init.vim Normal file
View File

@ -0,0 +1,19 @@
if !exists('g:vscode')
source ~/.config/nvim/basic-setting.vim
source ~/.config/nvim/plugconfig/indentline.vim
source ~/.config/nvim/plugconfig/vifm.vim
source ~/.config/nvim/plugconfig/vimwiki.vim
source ~/.config/nvim/plugconfig/easy-motion.vim
source ~/.config/nvim/plugconfig/undotree.vim
source ~/.config/nvim/plugconfig/emmet.vim
source ~/.config/nvim/plugconfig/table-mode.vim
source ~/.config/nvim/plugconfig/goyo.vim
source ~/.config/nvim/plugconfig/git-gutter.vim
source ~/.config/nvim/plugconfig/vim-airline.vim
source ~/.config/nvim/plugconfig/vim-hexokinase.vim
source ~/.config/nvim/plugconfig/vim-fzf.vim
source ~/.config/nvim/plugconfig/fern.vim
source ~/.config/nvim/plugconfig/vim-closetag.vim
source ~/.config/nvim/plugconfig/coc.vim
source ~/.config/nvim/plugconfig/netrw.vim
endif

View File

@ -0,0 +1,113 @@
" prettier command for coc
command! -nargs=0 Prettier :CocCommand prettier.formatFile
let g:coc_global_extensions = [
\ 'coc-snippets',
\ 'coc-pairs',
\ 'coc-prettier',
\ 'coc-tsserver',
\ 'coc-html',
\ 'coc-css',
\ 'coc-json',
\ 'coc-angular',
\ 'coc-explorer',
\ 'coc-vimtex',
\ 'coc-python',
\ 'coc-marketplace'
\ ]
noremap <silent> <A-f> :CocCommand explorer<CR>
" From Coc Readme
set updatetime=300
" Some servers have issues with backup files, see #649
set nobackup
set nowritebackup
" don't give |ins-completion-menu| messages.
set shortmess+=c
" always show signcolumns
set signcolumn=yes
" Use tab for trigger completion with characters ahead and navigate.
" Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use <c-space> to trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
" Coc only does snippet and additional edit on confirm.
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" Or use `complete_info` if your vim support it, like:
" inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
" Use `[g` and `]g` to navigate diagnostics
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
" Remap keys for gotos
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
endfunction
" Remap for rename current word
nmap <rn> <Plug>(coc-rename)
" Remap for format selected region
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
augroup mygroup
autocmd!
" Setup formatexpr specified filetype(s).
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
" Update signature help on jump placeholder
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
" Remap for do codeAction of selected region, ex: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
" Remap for do codeAction of current line
nmap <leader>ac <Plug>(coc-codeaction)
" Fix autofix problem of current line
nmap <leader>qf <Plug>(coc-fix-current)
" Create mappings for function text object, requires document symbols feature of languageserver.
xmap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap if <Plug>(coc-funcobj-i)
omap af <Plug>(coc-funcobj-a)
" Use `:Format` to format current buffer
command! -nargs=0 Format :call CocAction('format')
" Use `:Fold` to fold current buffer
command! -nargs=? Fold :call CocAction('fold', <f-args>)
" use `:OR` for organize import of current buffer
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
" Add status line support, for integration with other plugin, checkout `:h coc-status`
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}

View File

@ -0,0 +1,5 @@
map <leader><leader>. <Plug>(easymotion-repeat)
map <leader><leader>f <Plug>(easymotion-overwin-f)
map <leader><leader>j <Plug>(easymotion-overwin-line)
map <leader><leader>k <Plug>(easymotion-overwin-line)
map <leader><leader>w <Plug>(easymotion-overwin-w)

View File

@ -0,0 +1 @@
let g:user_emmet_leader_key='<A-c>'

View File

@ -0,0 +1,26 @@
let g:fern#drawer_width = 30
let g:fern#default_hidden = 1
let g:fern#disable_drawer_auto_quit = 1
"noremap <silent> <A-f> :Fern . -drawer -toggle <CR>
function! s:init_fern() abort
nmap <buffer> H <Plug>(fern-action-open:split)
nmap <buffer> V <Plug>(fern-action-open:vsplit)
nmap <buffer> R <Plug>(fern-action-rename)
nmap <buffer> M <Plug>(fern-action-move)
nmap <buffer> C <Plug>(fern-action-copy)
nmap <buffer> N <Plug>(fern-action-new-path)
nmap <buffer> T <Plug>(fern-action-new-file)
nmap <buffer> D <Plug>(fern-action-new-dir)
nmap <buffer> S <Plug>(fern-action-hidden-toggle)
nmap <buffer> dd <Plug>(fern-action-trash)
nmap <buffer> <leader> <Plug>(fern-action-mark)
endfunction
augroup fern-custom
autocmd! *
autocmd FileType fern call s:init_fern()
augroup END
let g:fern#renderer = "nerdfont"

View File

@ -0,0 +1,5 @@
nmap ) <Plug>(GitGutterNextHunk)
nmap ( <Plug>(GitGutterPrevHunk)
let g:gitgutter_enabled = 1
let g:gitgutter_map_keys = 0
let g:gitgutter_highlight_linenrs = 1

View File

@ -0,0 +1 @@
noremap <leader>g :Goyo<CR>

View File

@ -0,0 +1,35 @@
"let g:indentLine_showFirstIndentLevel = 1
"let g:indentLine_fileType = ['javascript', 'c']
let g:indentLine_fileTypeExclude = ["vimwiki", "coc-explorer", "help", "undotree", "diff"]
let g:indentLine_bufTypeExclude = ["help", "terminal"]
"let g:indentLine_bufNameExclude = []
let g:indentLine_indentLevel = 10
" Conceal settings
let g:indentLine_setConceal = 1
let g:indentLine_concealcursor = "incv"
let g:indentLine_conceallevel = 2
let g:indentLine_char = '|'
"let g:indentLine_char_list = ['|', '¦', '┆', '┊']
" Leading Space
"let g:indentLine_leadingSpaceEnabled = 1
let g:indentLine_leadingSpaceChar = "•"
" Use Theme Colors
"let g:indentLine_setColors = 0
" 16 Color
let g:indentLine_color_tty_light = 7 " (default: 4)
let g:indentLine_color_dark = 1 " (default: 2)
" 256
let g:indentLine_color_term = 239
" True Color
let g:indentLine_color_gui = '#616161'
" Background (256, True)
"let g:indentLine_bgcolor_term = 202
"let g:indentLine_bgcolor_gui = '#FF5F00'

View File

@ -0,0 +1,82 @@
let g:netrw_banner = 0
let g:netrw_liststyle = 3
let g:netrw_browse_split = 4
let g:netrw_winsize = 20
function! OpenToRight()
:normal v
let g:path=expand('%:p')
execute 'q!'
execute 'belowright vnew' g:path
:normal <C-w>l
endfunction
function! OpenBelow()
:normal v
let g:path=expand('%:p')
execute 'q!'
execute 'belowright new' g:path
:normal <C-w>l
endfunction
function! OpenTab()
:normal v
let g:path=expand('%:p')
execute 'q!'
execute 'tabedit' g:path
:normal <C-w>l
endfunction
function! NetrwMappings()
" Hack fix to make ctrl-l work properly
noremap <buffer> <A-l> <C-w>l
noremap <buffer> <C-l> <C-w>l
noremap <silent> <A-f> :call ToggleNetrw()<CR>
noremap <silent> <C-E> :call ToggleNetrw()<CR>
noremap <buffer> V :call OpenToRight()<cr>
noremap <buffer> H :call OpenBelow()<cr>
noremap <buffer> T :call OpenTab()<cr>
endfunction
augroup netrw_mappings
autocmd!
autocmd filetype netrw call NetrwMappings()
augroup END
" Allow for netrw to be toggled
function! ToggleNetrw()
if g:NetrwIsOpen
let i = bufnr("$")
while (i >= 1)
if (getbufvar(i, "&filetype") == "netrw")
silent exe "bwipeout " . i
endif
let i-=1
endwhile
let g:NetrwIsOpen=0
else
let g:NetrwIsOpen=1
silent Lexplore
endif
endfunction
" Check before opening buffer on any file
function! NetrwOnBufferOpen()
if exists('b:noNetrw')
return
endif
call ToggleNetrw()
endfun
" Close Netrw if it's the only buffer open
autocmd WinEnter * if winnr('$') == 1 && getbufvar(winbufnr(winnr()), "&filetype") == "netrw" || &buftype == 'quickfix' |q|endif
" Make netrw act like a project Draw
augroup ProjectDrawer
autocmd!
" Don't open Netrw
autocmd VimEnter ~/.config/joplin/tmp/*,/tmp/calcurse*,~/.calcurse/notes/*,~/vimwiki/*,*/.git/COMMIT_EDITMSG let b:noNetrw=1
autocmd VimEnter * :call NetrwOnBufferOpen()
augroup END
let g:NetrwIsOpen=0

View File

@ -0,0 +1,38 @@
call plug#begin('~/.config/nvim/plugged')
" Themes
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'tomasiser/vim-code-dark'
" Code Completion
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Tags
Plug 'alvan/vim-closetag'
Plug 'tpope/vim-surround'
Plug 'mattn/emmet-vim'
" Commenting
Plug 'tpope/vim-commentary'
" Syntax highlighting
Plug 'HerringtonDarkholme/yats.vim'
Plug 'yuezk/vim-js'
Plug 'maxmellon/vim-jsx-pretty'
Plug 'rust-lang/rust.vim'
" Motions
Plug 'easymotion/vim-easymotion'
" Git
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'
" Misc
Plug 'junegunn/fzf.vim'
Plug 'junegunn/goyo.vim'
Plug 'rrethy/vim-hexokinase', { 'do': 'make hexokinase' }
Plug 'vimwiki/vimwiki'
Plug 'tpope/vim-repeat'
Plug 'dhruvasagar/vim-table-mode'
Plug 'itchyny/calendar.vim'
Plug 'mbbill/undotree'
"Plug 'lambdalisue/fern.vim'
Plug 'lambdalisue/nerdfont.vim'
Plug 'lambdalisue/fern-renderer-nerdfont.vim'
call plug#end()

View File

@ -0,0 +1 @@
let g:table_mode_delete_row_map = "<leader>tdr"

View File

@ -0,0 +1,11 @@
nnoremap <A-u> :UndotreeToggle<CR>
let g:undotree_RelativeTimestamp = 1
let g:undotree_ShortIndicators = 1
let g:undotree_HelpLine = 0
let g:undotree_WindowLayout = 2
if has("persistent_undo")
set undodir=$HOME/.local/share/nvim/undodir
set undofile
endif

View File

@ -0,0 +1,6 @@
let g:vifm_replace_netrw = 1
let g:vifm_replace_netrw_cmd = "Vifm"
"let g:vifm_embed_term = 1
"let g:vifm_embed_split = 1
"let g:vifm_exec_args =

View File

@ -0,0 +1,3 @@
let g:airline#extensions#wordcount#enabled = 1
let g:airline#extensions#hunks#non_zero_only = 1
let g:airline_theme = 'codedark'

View File

@ -0,0 +1,31 @@
" filenames like *.xml, *.html, *.xhtml, ...
" These are the file extensions where this plugin is enabled.
let g:closetag_filenames = '*.html,*.xhtml,*.jsx,*.js,*.tsx'
" filenames like *.xml, *.xhtml, ...
" This will make the list of non-closing tags self-closing in the specified files.
let g:closetag_xhtml_filenames = '*.xml,*.xhtml,*.jsx,*.js,*.tsx'
" filetypes like xml, html, xhtml, ...
" These are the file types where this plugin is enabled.
let g:closetag_filetypes = 'html,xhtml,jsx,js,tsx'
" filetypes like xml, xhtml, ...
" This will make the list of non-closing tags self-closing in the specified files.
let g:closetag_xhtml_filetypes = 'xml,xhtml,jsx,js,tsx'
" integer value [0|1]
" This will make the list of non-closing tags case-sensitive (e.g. `<Link>` will be closed while `<link>` won't.)
let g:closetag_emptyTags_caseSensitive = 1
" Disables auto-close if not in a "valid" region (based on filetype)
let g:closetag_regions = {
\ 'typescript.tsx': 'jsxRegion,tsxRegion',
\ 'javascript.jsx': 'jsxRegion',
\ }
" Shortcut for closing tags, default is '>'
let g:closetag_shortcut = '>'
" Add > at current position without closing the current tag, default is ''
let g:closetag_close_shortcut = '<leader>>'

View File

@ -0,0 +1,7 @@
nnoremap <A-g> :GFiles<CR>
nnoremap <A-z> :Files<CR>
command! -bang -nargs=? -complete=dir Files
\ call fzf#vim#files(<q-args>, {'options': ['--preview', 'preview {}']}, <bang>0)
command! -bang -nargs=? -complete=dir GFiles
\ call fzf#vim#gitfiles(<q-args>, {'options': ['--preview', 'preview {}']}, <bang>0)

View File

@ -0,0 +1,16 @@
let g:Hexokinase_refreshEvents = ['InsertLeave']
let g:Hexokinase_optInPatterns = [
\ 'full_hex',
\ 'triple_hex',
\ 'rgb',
\ 'rgba',
\ 'hsl',
\ 'hsla',
\ 'colour_names'
\ ]
let g:Hexokinase_highlighters = ['backgroundfull']
" Reenable hexokinase on enter
autocmd VimEnter * HexokinaseTurnOn

View File

@ -0,0 +1 @@
let g:vimwiki_list = [{'path': '~/.local/share/vimwiki/', 'auto_diary_index': 1}]

View File

@ -0,0 +1,10 @@
cnoreabbrev W! w!
cnoreabbrev Q! q!
cnoreabbrev Qall! qall!
cnoreabbrev Wq wq
cnoreabbrev Wa wa
cnoreabbrev wQ wq
cnoreabbrev WQ wq
cnoreabbrev W w
cnoreabbrev Q q
cnoreabbrev Qall qall

View File

@ -0,0 +1,7 @@
" Vertically center document when entering insert mode
autocmd InsertEnter * norm zz
" Remove trailing whitespace on save
autocmd BufWritePre * %s/\s\+$//e

View File

@ -0,0 +1,29 @@
let mapleader=" "
" Use system clipboard
set clipboard+=unnamedplus
set mouse=v
syntax on
set ignorecase
set smartcase
set encoding=utf-8
set number relativenumber
" Tab Settings
set expandtab
set shiftwidth=2
set softtabstop=2
set tabstop=2
set path=.,,**
" Autocompletion
set wildmode=longest,list,full
" Fix splitting
set splitbelow splitright
" Cursor line
set cursorline
set cursorcolumn

View File

@ -0,0 +1,3 @@
highlight GitGutterAdd guifg=#009900 ctermfg=Green
highlight GitGutterChange guifg=#bbbb00 ctermfg=Yellow
highlight GitGutterDelete guifg=#ff2222 ctermfg=Red

View File

@ -0,0 +1,8 @@
" Guide navigation
noremap <leader><Tab> <Esc>/<++><Enter>"_c4l
inoremap <leader><Tab> <Esc>/<++><Enter>"_c4l
vnoremap <leader><Tab> <Esc>/<++><Enter>"_c4l
" general insert commands
inoremap ;g <++>

View File

@ -0,0 +1,11 @@
autocmd FileType markdown noremap <leader>r i---<CR>title:<Space><++><CR>author:<Space>"Brodie Robertson"<CR>geometry:<CR>-<Space>top=30mm<CR>-<Space>left=20mm<CR>-<Space>right=20mm<CR>-<Space>bottom=30mm<CR>header-includes:<Space>\|<CR><Tab>\usepackage{float}<CR>\let\origfigure\figure<CR>\let\endorigfigure\endfigure<CR>\renewenvironment{figure}[1][2]<Space>{<CR><Tab>\expandafter\origfigure\expandafter[H]<CR><BS>}<Space>{<CR><Tab>\endorigfigure<CR><BS>}<CR><BS>---<CR><CR>
autocmd FileType markdown inoremap ,i ![](<++>){#fig:<++>}<Space><CR><CR><++><Esc>kkF]i
autocmd FileType markdown inoremap ,a [](<++>)<Space><++><Esc>F]i
autocmd FileType markdown inoremap ,1 #<Space><CR><CR><++><Esc>2k<S-a>
autocmd FileType markdown inoremap ,2 ##<Space><CR><CR><++><Esc>2k<S-a>
autocmd FileType markdown inoremap ,3 ###<Space><CR><CR><++><Esc>2k<S-a>
autocmd FileType markdown inoremap ,4 ####<Space><CR><CR><++><Esc>2k<S-a>
autocmd FileType markdown inoremap ,5 #####<Space><CR><CR><++><Esc>2k<S-a>
autocmd FileType markdown inoremap ,u +<Space><CR><++><Esc>1k<S-a>
autocmd FileType markdown inoremap ,o 1.<Space><CR><++><Esc>1k<S-a>
autocmd FileType markdown inoremap ,f +@fig:

View File

@ -0,0 +1,6 @@
map <leader>b i#!/bin/sh<CR><CR>
autocmd FileType sh inoremap ,f ()<Space>{<CR><Tab><++><CR>}<CR><CR><++><Esc>?()<CR>
autocmd FileType sh inoremap ,i if<Space>[<Space>];<Space>then<CR><++><CR>fi<CR><CR><++><Esc>?];<CR>hi<Space>
autocmd FileType sh inoremap ,ei elif<Space>[<Space>];<Space>then<CR><++><CR><Esc>?];<CR>hi<Space>
autocmd FileType sh inoremap ,sw case<Space>""<Space>in<CR><++>)<Space><++><Space>;;<CR><++><CR>esac<CR><CR><++><Esc>?"<CR>i
autocmd FileType sh inoremap ,ca )<Space><++><Space>;;<CR><++><Esc>?)<CR>i

View File

@ -0,0 +1,64 @@
map <F1> <Nop>
imap <F1> <Nop>
" Basic file system commands
nnoremap <A-o> :!touch<Space>
nnoremap <A-e> :!crf<Space>
nnoremap <A-d> :!mkdir<Space>
nnoremap <A-m> :!mv<Space>%<Space>
" Tab
nnoremap <Tab> gt
nnoremap <S-Tab> gT
nnoremap <silent> <A-t> :tabnew<CR>
nnoremap <silent> <A-2> :tabmove +<CR>
nnoremap <silent> <A-1> :tabmove -<CR>
" center screen after search
nnoremap n nzzzv
nnoremap N Nzzzv
" Fix Y behaviour
nmap Y y$
" Fix indenting visual block
vmap < <gv
vmap > >gv
" Enable and disable auto comment
map <leader>c :setlocal formatoptions-=cro<CR>
map <leader>C :setlocal formatoptions=cro<CR>
" Enable spell checking, s for spell check
map <leader>s :setlocal spell! spelllang=en_au<CR>
" Enable Disable Auto Indent
map <leader>i :setlocal autoindent<CR>
map <leader>I :setlocal noautoindent<CR>
" Shell check
map <leader>p :!clear && shellcheck %<CR>
" Compile and open output
map <leader>G :w! \| !comp <c-r>%<CR><CR>
map <leader>o :!opout <c-r>%<CR><CR>
" Shortcutting split navigation
map <A-h> <C-w>h
map <A-j> <C-w>j
map <A-k> <C-w>k
map <A-l> <C-w>l
" Tab shortcuts
nnoremap <A-p> :tabp<CR>
nnoremap <A-n> :tabn<CR>
" Alias replace all to
nnoremap <A-s> :%s//gI<Left><Left><Left>
" Alias write and quit to Q
nnoremap <leader>q :wq<CR>
nnoremap <leader>w :w<CR>
" Save file as sudo when no sudo permissions
cmap w!! w !sudo tee > /dev/null %

View File

@ -0,0 +1,77 @@
let SessionLoad = 1
let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0
let v:this_session=expand("<sfile>:p")
silent only
cd ~/
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
let s:wipebuf = bufnr('%')
endif
set shortmess=aoO
badd +1 ~/.zshenv
badd +0 ~/.bash_profile
argglobal
%argdel
edit ~/.zshenv
set splitbelow splitright
wincmd _ | wincmd |
vsplit
1wincmd h
wincmd w
wincmd t
set winminheight=0
set winheight=1
set winminwidth=0
set winwidth=1
exe 'vert 1resize ' . ((&columns * 72 + 72) / 145)
exe 'vert 2resize ' . ((&columns * 72 + 72) / 145)
argglobal
setlocal fdm=manual
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=0
setlocal fml=1
setlocal fdn=20
setlocal fen
silent! normal! zE
let s:l = 1 - ((0 * winheight(0) + 17) / 34)
if s:l < 1 | let s:l = 1 | endif
exe s:l
normal! zt
1
normal! 0
wincmd w
argglobal
if bufexists("~/.bash_profile") | buffer ~/.bash_profile | else | edit ~/.bash_profile | endif
setlocal fdm=manual
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=0
setlocal fml=1
setlocal fdn=20
setlocal fen
silent! normal! zE
let s:l = 1 - ((0 * winheight(0) + 17) / 34)
if s:l < 1 | let s:l = 1 | endif
exe s:l
normal! zt
1
normal! 01|
wincmd w
exe 'vert 1resize ' . ((&columns * 72 + 72) / 145)
exe 'vert 2resize ' . ((&columns * 72 + 72) / 145)
tabnext 1
if exists('s:wipebuf') && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal'
silent exe 'bwipe ' . s:wipebuf
endif
unlet! s:wipebuf
set winheight=1 winwidth=20 winminheight=1 winminwidth=1 shortmess=filnxtToOFc
let s:sx = expand("<sfile>:p:r")."x.vim"
if file_readable(s:sx)
exe "source " . fnameescape(s:sx)
endif
let &so = s:so_save | let &siso = s:siso_save
doautoall SessionLoadPost
unlet SessionLoad
" vim: set ft=vim :

View File

@ -0,0 +1,83 @@
let SessionLoad = 1
let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0
let v:this_session=expand("<sfile>:p")
silent only
cd ~/
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
let s:wipebuf = bufnr('%')
endif
set shortmess=aoO
argglobal
%argdel
set splitbelow splitright
wincmd _ | wincmd |
vsplit
1wincmd h
wincmd w
wincmd _ | wincmd |
split
1wincmd k
wincmd w
wincmd t
set winminheight=0
set winheight=1
set winminwidth=0
set winwidth=1
exe 'vert 1resize ' . ((&columns * 72 + 72) / 145)
exe '2resize ' . ((&lines * 16 + 17) / 35)
exe 'vert 2resize ' . ((&columns * 72 + 72) / 145)
exe '3resize ' . ((&lines * 16 + 17) / 35)
exe 'vert 3resize ' . ((&columns * 72 + 72) / 145)
argglobal
enew
setlocal fdm=manual
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=0
setlocal fml=1
setlocal fdn=20
setlocal fen
wincmd w
argglobal
enew
setlocal fdm=manual
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=0
setlocal fml=1
setlocal fdn=20
setlocal fen
wincmd w
argglobal
enew
setlocal fdm=manual
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=0
setlocal fml=1
setlocal fdn=20
setlocal fen
wincmd w
3wincmd w
exe 'vert 1resize ' . ((&columns * 72 + 72) / 145)
exe '2resize ' . ((&lines * 16 + 17) / 35)
exe 'vert 2resize ' . ((&columns * 72 + 72) / 145)
exe '3resize ' . ((&lines * 16 + 17) / 35)
exe 'vert 3resize ' . ((&columns * 72 + 72) / 145)
tabnext 1
if exists('s:wipebuf') && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal'
silent exe 'bwipe ' . s:wipebuf
endif
unlet! s:wipebuf
set winheight=1 winwidth=20 winminheight=1 winminwidth=1 shortmess=filnxtToOFc
let s:sx = expand("<sfile>:p:r")."x.vim"
if file_readable(s:sx)
exe "source " . fnameescape(s:sx)
endif
let &so = s:so_save | let &siso = s:siso_save
doautoall SessionLoadPost
unlet SessionLoad
" vim: set ft=vim :

BIN
.config/nvim/shada/test.vim Normal file

Binary file not shown.

Submodule .config/nvim/vim-code-dark added at e56e5285ec