Compare commits
103 Commits
3c06504075
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| d30553d2d2 | |||
| 271aa3182b | |||
| 6a9ca5c23d | |||
| 0edac00442 | |||
| cc9e42b469 | |||
| 1274eb0597 | |||
| 18ae6546e6 | |||
| 7f94c04724 | |||
| 9bc08347a8 | |||
| b7ca4be5cf | |||
| fdc6ea1ef3 | |||
| 08bf9e7354 | |||
| 81ac79f7b4 | |||
| 97bd1e0365 | |||
| 9dbe4a87c0 | |||
| b052f7fa32 | |||
| fe39e86bb5 | |||
| aaf5d31567 | |||
| d2821c7df6 | |||
| 750376d311 | |||
|
|
0793816ad0 | ||
|
|
063e68f7de | ||
| c63cb6ae86 | |||
| a2c808e92d | |||
| 41a036f3ec | |||
| 48dd07630c | |||
| b2bacfae4f | |||
|
|
6db5468bfe | ||
| 6372ff4c5d | |||
| 89fdfb9fec | |||
| f4f82ad175 | |||
| 97f7d506f8 | |||
| 244c5ed80c | |||
| 67569b9a13 | |||
| 91e5cd5405 | |||
| 0fa0c06df9 | |||
| d0cfda726a | |||
| 5669fb21aa | |||
| 2784a69fe3 | |||
| 20e6cb3e9b | |||
| 8b9ec43532 | |||
| 501dab269b | |||
|
|
6aeec2bcb4 | ||
| 068e40a4cf | |||
| b17087c810 | |||
|
|
65143d2276 | ||
| 0c62678a90 | |||
| 66ec1489f5 | |||
| 529508f7db | |||
| 46237ae49c | |||
| 4a23a48109 | |||
| 8b5d5e7fd5 | |||
| 2a420ecb04 | |||
| e43aa0908e | |||
| f8872bea78 | |||
| 9b4cce2f4f | |||
| 5b5fc220d1 | |||
| 754b89b71a | |||
| 36184cddd4 | |||
| de4af48ee6 | |||
| f9039e7772 | |||
|
|
9f3a47b2e1 | ||
| 352d1f77c6 | |||
| ba1cd76362 | |||
| 8298e74e22 | |||
| 376bfe60ee | |||
| d81ebbc07a | |||
| 729eabb51e | |||
| 8617207a46 | |||
| fc2e6f39d4 | |||
| 36fc79597a | |||
| 65236003c5 | |||
| 945f805543 | |||
| 993d717dfa | |||
| 42808dbf59 | |||
| fa67c5f5bf | |||
| bdf7cbd88c | |||
| d3407f9bab | |||
| faa5aed9ed | |||
| 3822bfed91 | |||
| e64fc7a335 | |||
| fab299fa13 | |||
| 802effee7e | |||
| f7b1ea4b5b | |||
| 6f9fdab429 | |||
| 36bf857053 | |||
|
|
eaa36969c3 | ||
| 78cd1de02a | |||
| 65a17e9d5e | |||
| bad34f2ce4 | |||
| 640034fb84 | |||
| eb31c22500 | |||
| 3a1a81a671 | |||
| de84627ad1 | |||
| b6028f8adb | |||
| 25a08e9aa5 | |||
| 3123869e3c | |||
| dc1af50d80 | |||
| 8a0582e0d5 | |||
| 5613555960 | |||
| c34b245398 | |||
| be3400c9f4 | |||
| 6d72737816 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
.vim/.netrwhist
|
.vim/.netrwhist
|
||||||
|
.vim/plugged/*
|
||||||
|
|||||||
2
.vim/.gitignore
vendored
2
.vim/.gitignore
vendored
@@ -1,2 +0,0 @@
|
|||||||
spell/*
|
|
||||||
plugged/*
|
|
||||||
30
.vim/ExtractWikiLinks.vim
Normal file
30
.vim/ExtractWikiLinks.vim
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
function! ExtractWikiLinks()
|
||||||
|
let links = []
|
||||||
|
let pattern = '\v\[\[([^\]]+)\]\]'
|
||||||
|
let linenr = 1
|
||||||
|
while linenr <= line('$')
|
||||||
|
let line = getline(linenr)
|
||||||
|
let match = match(line, pattern)
|
||||||
|
while match != -1
|
||||||
|
let link_start = match + 2 " Start after '[['
|
||||||
|
let link_end = matchend(line, pattern) - 2 " End before ']]'
|
||||||
|
if link_end > link_start
|
||||||
|
let link = strpart(line, link_start, link_end - link_start)
|
||||||
|
call add(links, link)
|
||||||
|
endif
|
||||||
|
let match = match(line, pattern, matchend(line, pattern)) " Find next match
|
||||||
|
endwhile
|
||||||
|
let linenr = linenr + 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
" Open a new buffer with the extracted links
|
||||||
|
new
|
||||||
|
" Make the buffer modifiable temporarily
|
||||||
|
set modifiable
|
||||||
|
call setline(1, links)
|
||||||
|
" Set the buffer options after writing
|
||||||
|
set nomodifiable buftype=nofile bufhidden=wipe nobuflisted noswapfile
|
||||||
|
echo "Extracted " . len(links) . " wiki links."
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
command! ExtractLinks call ExtractWikiLinks()
|
||||||
File diff suppressed because it is too large
Load Diff
2863
.vim/autoload/plug.vim.old
Normal file
2863
.vim/autoload/plug.vim.old
Normal file
File diff suppressed because it is too large
Load Diff
1
.vim/spell/.gitattributes
vendored
Normal file
1
.vim/spell/.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.add merge=union
|
||||||
2
.vim/spell/.gitignore
vendored
Normal file
2
.vim/spell/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
*.spl
|
||||||
|
*.sug
|
||||||
89
.vim/spell/en.utf-8.add
Normal file
89
.vim/spell/en.utf-8.add
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
Ansible
|
||||||
|
Applebee's
|
||||||
|
CentOS
|
||||||
|
Cinemark
|
||||||
|
Crissy
|
||||||
|
Cuyahoga
|
||||||
|
Debian
|
||||||
|
Dialogue
|
||||||
|
Facebook
|
||||||
|
HDFS
|
||||||
|
HQL
|
||||||
|
Hadoop
|
||||||
|
IRC
|
||||||
|
Kubernetes
|
||||||
|
MapReduce
|
||||||
|
ODBC
|
||||||
|
Offline
|
||||||
|
OverDrive
|
||||||
|
PHP
|
||||||
|
Pantek
|
||||||
|
Portainer
|
||||||
|
Royalton
|
||||||
|
SQL
|
||||||
|
Strongsville
|
||||||
|
Syncthing
|
||||||
|
TiddlyWiki
|
||||||
|
Trello
|
||||||
|
Ubuntu
|
||||||
|
blogspot
|
||||||
|
dotfiles
|
||||||
|
hemangioma
|
||||||
|
http
|
||||||
|
java
|
||||||
|
offline
|
||||||
|
online
|
||||||
|
sudo
|
||||||
|
UFW
|
||||||
|
VPS
|
||||||
|
Gitea
|
||||||
|
Nginx
|
||||||
|
FreshRSS
|
||||||
|
planethawleywood
|
||||||
|
Nextcloud
|
||||||
|
Obsidian
|
||||||
|
Grimoires
|
||||||
|
qTest
|
||||||
|
Tricentis
|
||||||
|
Chromebook
|
||||||
|
daylogs
|
||||||
|
Daylog
|
||||||
|
Atomoxetine
|
||||||
|
Methylphenidate
|
||||||
|
Strattera
|
||||||
|
Chipotle
|
||||||
|
cystoscopy
|
||||||
|
Aamon
|
||||||
|
Parma
|
||||||
|
Astaroth
|
||||||
|
Strongbad
|
||||||
|
CPAP
|
||||||
|
Chromebooks
|
||||||
|
Lomaira
|
||||||
|
Proxmox
|
||||||
|
MySQL
|
||||||
|
chawley
|
||||||
|
phansible
|
||||||
|
Abaddon
|
||||||
|
ChromeOS
|
||||||
|
TeachingBooks
|
||||||
|
NeuroSquad
|
||||||
|
Wormdingler
|
||||||
|
jinja
|
||||||
|
TODO
|
||||||
|
Neovim
|
||||||
|
Zettelkasten
|
||||||
|
Harpocrates
|
||||||
|
Weechat
|
||||||
|
Lorain
|
||||||
|
Meadowbrook
|
||||||
|
NotebookLLM
|
||||||
|
Satola
|
||||||
|
DeSha
|
||||||
|
Redis
|
||||||
|
hostname
|
||||||
|
Shawshank
|
||||||
|
Delly
|
||||||
|
tmux
|
||||||
|
freecycle
|
||||||
|
ReadEra
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
# ---------------------------------------------------------------------------------------------------------------------
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
# ==>
|
" ==>
|
||||||
#
|
"
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
:insert
|
|
||||||
---
|
|
||||||
layout: post
|
|
||||||
title:
|
|
||||||
date:
|
|
||||||
categories:
|
|
||||||
---
|
|
||||||
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
:insert
|
|
||||||
# title
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
|
|
||||||
8
.vim/templates/mdfm
Normal file
8
.vim/templates/mdfm
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
:insert
|
||||||
|
---
|
||||||
|
filecreated:
|
||||||
|
fileupdated:
|
||||||
|
filetags: [current]
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
@@ -1,20 +1,14 @@
|
|||||||
:insert
|
:insert
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
#
|
|
||||||
# FILE:
|
# FILE:
|
||||||
#
|
|
||||||
# USAGE:
|
# USAGE:
|
||||||
#
|
|
||||||
# DESCRIPTION:
|
# DESCRIPTION:
|
||||||
#
|
|
||||||
# OPTIONS:
|
# OPTIONS:
|
||||||
# REQUIREMENTS:
|
# REQUIREMENTS:
|
||||||
# NOTES:
|
# NOTES:
|
||||||
# AUTHOR:
|
# AUTHOR:
|
||||||
# ORGANIZATION:
|
|
||||||
# CREATED:
|
# CREATED:
|
||||||
# REVISION:
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|
||||||
set -o nounset # Treat unset variables as an error
|
set -o nounset # Treat unset variables as an error
|
||||||
|
|||||||
16
.vim/templates/rlfm
Normal file
16
.vim/templates/rlfm
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
:insert
|
||||||
|
---
|
||||||
|
filecreated:
|
||||||
|
fileupdated:
|
||||||
|
filetags: [readinglist]
|
||||||
|
booktitle:
|
||||||
|
bookauthor:
|
||||||
|
bookstarted:
|
||||||
|
bookfinished:
|
||||||
|
---
|
||||||
|
|
||||||
|
# booktitle
|
||||||
|
|
||||||
|
## Highlights / Notes
|
||||||
|
|
||||||
|
|
||||||
@@ -2,15 +2,13 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
#
|
#
|
||||||
# FILE:
|
# FILE: filename
|
||||||
# USAGE:
|
# USAGE:
|
||||||
# DESCRIPTION:
|
# DESCRIPTION:
|
||||||
# OPTIONS:
|
|
||||||
# REQUIREMENTS:
|
|
||||||
# NOTES:
|
# NOTES:
|
||||||
# AUTHOR: C Hawley
|
# AUTHOR: C Hawley
|
||||||
# CREATED:
|
# CREATED:
|
||||||
# REVISION:
|
# UPDATED:
|
||||||
#
|
#
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|
||||||
|
|||||||
120
.vim/vim-setcolors.vim
Normal file
120
.vim/vim-setcolors.vim
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
" Change the color scheme from a list of color scheme names.
|
||||||
|
" Version 2010-09-12 from http://vim.wikia.com/wiki/VimTip341
|
||||||
|
" Press key:
|
||||||
|
" F8 next scheme
|
||||||
|
" Shift-F8 previous scheme
|
||||||
|
" Alt-F8 random scheme
|
||||||
|
" Set the list of color schemes used by the above (default is 'all'):
|
||||||
|
" :SetColors all (all $VIMRUNTIME/colors/*.vim)
|
||||||
|
" :SetColors my (names built into script)
|
||||||
|
" :SetColors blue slate ron (these schemes)
|
||||||
|
" :SetColors (display current scheme names)
|
||||||
|
" Set the current color scheme based on time of day:
|
||||||
|
" :SetColors now
|
||||||
|
if v:version < 700 || exists('loaded_setcolors') || &cp
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let loaded_setcolors = 1
|
||||||
|
let s:mycolors = ['slate', 'torte', 'darkblue', 'delek', 'murphy', 'elflord', 'pablo', 'koehler'] " colorscheme names that we use to set color
|
||||||
|
|
||||||
|
" Set list of color scheme names that we will use, except
|
||||||
|
" argument 'now' actually changes the current color scheme.
|
||||||
|
function! s:SetColors(args)
|
||||||
|
if len(a:args) == 0
|
||||||
|
echo 'Current color scheme names:'
|
||||||
|
let i = 0
|
||||||
|
while i < len(s:mycolors)
|
||||||
|
echo ' '.join(map(s:mycolors[i : i+4], 'printf("%-14s", v:val)'))
|
||||||
|
let i += 5
|
||||||
|
endwhile
|
||||||
|
elseif a:args == 'all'
|
||||||
|
let paths = split(globpath(&runtimepath, 'colors/*.vim'), "\n")
|
||||||
|
let s:mycolors = uniq(sort(map(paths, 'fnamemodify(v:val, ":t:r")')))
|
||||||
|
echo 'List of colors set from all installed color schemes'
|
||||||
|
elseif a:args == 'my'
|
||||||
|
let c1 = 'default elflord peachpuff desert256 breeze morning'
|
||||||
|
let c2 = 'darkblue gothic aqua earth black_angus relaxedgreen'
|
||||||
|
let c3 = 'darkblack freya motus impact less chocolateliquor'
|
||||||
|
let s:mycolors = split(c1.' '.c2.' '.c3)
|
||||||
|
echo 'List of colors set from built-in names'
|
||||||
|
elseif a:args == 'now'
|
||||||
|
call s:HourColor()
|
||||||
|
else
|
||||||
|
let s:mycolors = split(a:args)
|
||||||
|
echo 'List of colors set from argument (space-separated names)'
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
command! -nargs=* SetColors call s:SetColors('<args>')
|
||||||
|
|
||||||
|
" Set next/previous/random (how = 1/-1/0) color from our list of colors.
|
||||||
|
" The 'random' index is actually set from the current time in seconds.
|
||||||
|
" Global (no 's:') so can easily call from command line.
|
||||||
|
function! NextColor(how)
|
||||||
|
call s:NextColor(a:how, 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Helper function for NextColor(), allows echoing of the color name to be
|
||||||
|
" disabled.
|
||||||
|
function! s:NextColor(how, echo_color)
|
||||||
|
if len(s:mycolors) == 0
|
||||||
|
call s:SetColors('all')
|
||||||
|
endif
|
||||||
|
if exists('g:colors_name')
|
||||||
|
let current = index(s:mycolors, g:colors_name)
|
||||||
|
else
|
||||||
|
let current = -1
|
||||||
|
endif
|
||||||
|
let missing = []
|
||||||
|
let how = a:how
|
||||||
|
for i in range(len(s:mycolors))
|
||||||
|
if how == 0
|
||||||
|
let current = localtime() % len(s:mycolors)
|
||||||
|
let how = 1 " in case random color does not exist
|
||||||
|
else
|
||||||
|
let current += how
|
||||||
|
if !(0 <= current && current < len(s:mycolors))
|
||||||
|
let current = (how>0 ? 0 : len(s:mycolors)-1)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
try
|
||||||
|
execute 'colorscheme '.s:mycolors[current]
|
||||||
|
break
|
||||||
|
catch /E185:/
|
||||||
|
call add(missing, s:mycolors[current])
|
||||||
|
endtry
|
||||||
|
endfor
|
||||||
|
redraw
|
||||||
|
if len(missing) > 0
|
||||||
|
echo 'Error: colorscheme not found:' join(missing)
|
||||||
|
endif
|
||||||
|
if (a:echo_color)
|
||||||
|
echo g:colors_name
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
nnoremap <F8> :call NextColor(1)<CR>
|
||||||
|
nnoremap <S-F8> :call NextColor(-1)<CR>
|
||||||
|
nnoremap <A-F8> :call NextColor(0)<CR>
|
||||||
|
|
||||||
|
" Set color scheme according to current time of day.
|
||||||
|
function! s:HourColor()
|
||||||
|
let hr = str2nr(strftime('%H'))
|
||||||
|
if hr <= 3
|
||||||
|
let i = 0
|
||||||
|
elseif hr <= 7
|
||||||
|
let i = 1
|
||||||
|
elseif hr <= 14
|
||||||
|
let i = 2
|
||||||
|
elseif hr <= 18
|
||||||
|
let i = 3
|
||||||
|
else
|
||||||
|
let i = 4
|
||||||
|
endif
|
||||||
|
let nowcolors = 'elflord morning desert evening pablo'
|
||||||
|
execute 'colorscheme '.split(nowcolors)[i]
|
||||||
|
redraw
|
||||||
|
echo g:colors_name
|
||||||
|
endfunction
|
||||||
|
|
||||||
526
.vimrc
526
.vimrc
@@ -1,24 +1,53 @@
|
|||||||
" ---------------------------------------------------------------------------------------------------------------------
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
" ==> .vimrc
|
" ==> .vimrc
|
||||||
|
|
||||||
set nocompatible " be iMproved, required
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
set number " turn on line numbers
|
" ==> Some settings from Vim Zero: https://www.oliversherouse.com/posts/vim_zero.html
|
||||||
set relativenumber " lines are numbered relative to current line
|
"
|
||||||
set scrolloff=8 " number of lines to keep above and below the cursor
|
syntax enable
|
||||||
set belloff=all " no sound/flash on errors
|
filetype plugin on
|
||||||
|
|
||||||
|
" General
|
||||||
|
let mapleader = '\'
|
||||||
set autoread " set to auto read when a file is changed from the outside
|
set autoread " set to auto read when a file is changed from the outside
|
||||||
|
set belloff=all " no sound/flash on errors
|
||||||
set cursorcolumn " highlight current column
|
set cursorcolumn " highlight current column
|
||||||
set cursorline " highlight current row
|
set cursorline " highlight current row
|
||||||
set incsearch " make search act like search in modern browsers
|
set formatoptions-=rot " Turn off autoinsert of comment char on newline
|
||||||
set showmatch " show matching brackets when text indicator is over them
|
set hidden " Allow background buffers without saving
|
||||||
|
set nolist " do not show invisible characters
|
||||||
set term=xterm-256color " LOTS of colors
|
set nocompatible " be iMproved, required
|
||||||
|
set number " turn on line numbers
|
||||||
set path+=** " Search Globally
|
set path+=** " Search Globally
|
||||||
set wildmenu
|
set relativenumber " lines are numbered relative to current line
|
||||||
|
set ruler " show cursor poition
|
||||||
|
set scrolloff=10 " number of lines to keep above and below the cursor
|
||||||
|
set showmatch " show matching brackets when text indicator is over them
|
||||||
|
set splitright " Split to right by default
|
||||||
|
if !has('nvim')
|
||||||
|
set term=xterm-256color " LOTS of colors
|
||||||
|
endif
|
||||||
|
set wildmenu " enhanced command line completion
|
||||||
|
set fillchars=vert:\|,fold:.,diff:-
|
||||||
|
|
||||||
|
" Text Wrapping
|
||||||
|
set colorcolumn= " disable colorzing <textwidth> column
|
||||||
|
set nowrap " turn off word wrapping at <textwidth>
|
||||||
|
|
||||||
|
" Search and Substitute
|
||||||
|
set gdefault " use global flag by default in s: commands
|
||||||
|
set hlsearch " highlight searches
|
||||||
|
set ignorecase " ignore case in searches
|
||||||
|
set incsearch " make search act like search in modern browsers
|
||||||
|
set smartcase " don't ignore capitals in searches
|
||||||
|
|
||||||
|
" Tabs
|
||||||
|
set tabstop=4
|
||||||
|
set softtabstop=4
|
||||||
|
set shiftwidth=4
|
||||||
|
set expandtab
|
||||||
|
|
||||||
autocmd! bufwritepost .vimrc source ~/.vimrc " When vimrc is edited, reload it
|
autocmd! bufwritepost .vimrc source ~/.vimrc " When vimrc is edited, reload it
|
||||||
|
|
||||||
" Turn line numbers on/off for active/inactive buffers
|
" Turn line numbers on/off for active/inactive buffers
|
||||||
augroup BgHighlight
|
augroup BgHighlight
|
||||||
autocmd!
|
autocmd!
|
||||||
@@ -28,267 +57,390 @@ augroup BgHighlight
|
|||||||
autocmd WinLeave * set norelativenumber
|
autocmd WinLeave * set norelativenumber
|
||||||
augroup end
|
augroup end
|
||||||
|
|
||||||
syntax enable
|
" Toggle invisible characters with <F5>
|
||||||
filetype plugin on
|
set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<
|
||||||
|
noremap <F5> :set list!<CR>
|
||||||
|
inoremap <F5> <C-o>:set list!<CR>
|
||||||
|
cnoremap <F5> <C-c>:set list!<CR>
|
||||||
|
|
||||||
|
" Enable Omnicomplete features
|
||||||
|
set omnifunc=syntaxcomplete#Complete
|
||||||
|
|
||||||
|
" Personal Notes settings
|
||||||
|
" export NOTES_DIR=<your notes directory> before use
|
||||||
|
" Go to index of notes and set working directory
|
||||||
|
nnoremap <leader>nn :e $NOTES_DIR/index.md<CR>:cd $NOTES_DIR<CR>
|
||||||
|
|
||||||
|
" <leader>[ to grep inside Notes files
|
||||||
|
" I got the idea from here [step 6: search contents of your notes](https://www.edwinwenink.xyz/posts/42-vim_notetaking/#step-6-search-contents-of-your-notes)
|
||||||
|
command! -nargs=1 Ngrep vimgrep "<args>" $NOTES_DIR/**/*.md | copen
|
||||||
|
nnoremap <leader>[ :Ngrep
|
||||||
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
" ==> From Vim Zero: https://www.oliversherouse.com/2017/08/21/vim_zero.html
|
" ==> Plugins with VimPlug
|
||||||
|
" A minimalist Vim plugin manager
|
||||||
|
" https://github.com/junegunn/vim-plug
|
||||||
|
|
||||||
" General
|
|
||||||
let mapleader = '\'
|
|
||||||
set hidden " Allow background buffers without saving
|
|
||||||
set splitright " Split to right by default
|
|
||||||
set formatoptions-=ro " Turn off autoinsert of comment char on newline
|
|
||||||
|
|
||||||
" Text Wrapping
|
|
||||||
set textwidth=120
|
|
||||||
set colorcolumn= " disable color column
|
|
||||||
set nowrap
|
|
||||||
|
|
||||||
" Search and Substitute
|
|
||||||
set gdefault " use global flag by default in s: commands
|
|
||||||
set hlsearch " highlight searches
|
|
||||||
set ignorecase " ignore case in searches
|
|
||||||
set smartcase " don't ignore capitals in searches
|
|
||||||
|
|
||||||
" Tabs
|
|
||||||
set tabstop=4
|
|
||||||
set softtabstop=4
|
|
||||||
set shiftwidth=4
|
|
||||||
set expandtab
|
|
||||||
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
|
||||||
" ==> Plugins
|
|
||||||
|
|
||||||
"" Installation with VimPlug
|
|
||||||
if has("win32")
|
if has("win32")
|
||||||
call plug#begin('~/vimfiles/plugged')
|
call plug#begin('~/vimfiles/plugged')
|
||||||
else
|
else
|
||||||
call plug#begin('~/.vim/plugged')
|
call plug#begin('~/.vim/plugged')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
""" Basics
|
" Think of sensible.vim as one step above 'nocompatible' mode: a universal set of defaults that (hopefully) everyone can agree on
|
||||||
" ...one step above 'nocompatible' mode: a universal set of defaults that (hopefully) everyone can agree on.
|
" https://github.com/tpope/vim-sensible
|
||||||
Plug 'tpope/vim-sensible'
|
Plug 'tpope/vim-sensible'
|
||||||
|
|
||||||
" Syntax highlights for markdown
|
" One stop shop for vim colorschemes
|
||||||
Plug 'tpope/vim-markdown'
|
" https://github.com/flazz/vim-colorschemes
|
||||||
|
|
||||||
" one stop shop for vim color schemes.
|
|
||||||
Plug 'flazz/vim-colorschemes'
|
Plug 'flazz/vim-colorschemes'
|
||||||
|
|
||||||
" Command Line Fuzzy Finder - https://github.com/junegunn/fzf
|
" Command Line Fuzzy Finder
|
||||||
|
" https://github.com/junegunn/fzf
|
||||||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
|
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
|
||||||
Plug 'junegunn/fzf.vim'
|
Plug 'junegunn/fzf.vim'
|
||||||
|
|
||||||
" fugitive.vim for git
|
" Fugitive is the premier Vim plugin for Git. Or maybe it's the premier Git plugin for Vim? Either way,
|
||||||
|
" it's so awesome, it should be illegal. That's why it's called Fugitive
|
||||||
|
" https://github.com/tpope/vim-fugitive
|
||||||
Plug 'tpope/vim-fugitive'
|
Plug 'tpope/vim-fugitive'
|
||||||
|
|
||||||
" vim.vinegar
|
" Vim surround
|
||||||
Plug 'tpope/vim-vinegar'
|
" I tried to do this from scratch, but it seems this is the best alternative
|
||||||
|
" https://github.com/tpope/vim-surround
|
||||||
|
Plug 'tpope/vim-surround'
|
||||||
|
|
||||||
" Linter
|
" Vim Markdown
|
||||||
Plug 'dense-analysis/ale'
|
" Suggestions from [Writing Markdown in Vim](https://codeinthehole.com/tips/writing-markdown-in-vim/)
|
||||||
|
" [Vim Markdown](https://github.com/preservim/vim-markdown)
|
||||||
|
Plug 'godlygeek/tabular'
|
||||||
|
Plug 'preservim/vim-markdown'
|
||||||
|
|
||||||
" Syntax highlights for multiple languages
|
" Vim Spellsync
|
||||||
"Plug 'sheerun/vim-polyglot'
|
" Magically rebuild Vim spell files if word lists are modified outside of Vim
|
||||||
|
" https://github.com/micarmst/vim-spellsync
|
||||||
|
Plug 'micarmst/vim-spellsync'
|
||||||
|
|
||||||
|
" Vim Bullets
|
||||||
|
" I tried for too long to get Martkdown bullet to work right.
|
||||||
|
" https://github.com/bullets-vim/bullets.vim
|
||||||
|
Plug 'bullets-vim/bullets.vim'
|
||||||
|
|
||||||
|
" Vim Airline
|
||||||
|
" Lean & mean status/tabline for vim that's light as air.
|
||||||
|
" https://github.com/vim-airline/vim-airline
|
||||||
|
Plug 'vim-airline/vim-airline'
|
||||||
|
Plug 'vim-airline/vim-airline-themes'
|
||||||
|
|
||||||
|
" vim-signify
|
||||||
|
" https://github.com/mhinz/vim-signify
|
||||||
|
Plug 'mhinz/vim-signify'
|
||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
" ==> Plugin options
|
" ==> Plugin Options
|
||||||
|
" Options and overrides for installed plugins
|
||||||
|
|
||||||
|
" Vim Markdown
|
||||||
|
|
||||||
|
" Markdown syntax highlighting for specified languages
|
||||||
|
let g:markdown_fenced_languages = ['html', 'python', 'ini', 'vim', 'bash', 'yaml']
|
||||||
|
|
||||||
|
" Set default conceallevel to hide links and some formatting
|
||||||
|
set conceallevel=0
|
||||||
|
|
||||||
|
" strikethrough
|
||||||
|
let g:vim_markdown_strikethrough = 1
|
||||||
|
|
||||||
|
" follow anchors - allow <ge> to follow anchors just like links
|
||||||
|
let g:vim_markdown_follow_anchor = 1
|
||||||
|
" turn off auto-bullets and indent so `gq` works correctly
|
||||||
|
let g:vim_markdown_auto_insert_bullets=0
|
||||||
|
let g:vim_markdown_new_list_item_indent=0
|
||||||
|
let g:vim_markdown_frontmatter = 1
|
||||||
|
let g:vim_markdown_folding_disabled = 1
|
||||||
|
|
||||||
|
" Open folds by default
|
||||||
|
au BufWinEnter * normal zR
|
||||||
|
|
||||||
|
" bullets-vim
|
||||||
|
let g:bullets_enabled_file_types = [ 'markdown', 'gitcommit' ]
|
||||||
|
let g:bullets_outline_levels = ['num', 'abc', 'std*', 'std+', 'std-']
|
||||||
|
|
||||||
|
"vim-airline
|
||||||
|
let g:airline_extensions = ['hunks', 'branch', 'tabline']
|
||||||
|
let g:airline_detect_theme_from_guicolors = 1
|
||||||
|
let g:airline_powerline_fonts = 1
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
|
" ==> FZF Helper Functions
|
||||||
"
|
"
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
" Configure FZF default key bindings (actions) within the FZF window
|
||||||
" ==> Colors
|
" 'ctrl-x': Open in horizontal split
|
||||||
"
|
" 'ctrl-v': Open in vertical split
|
||||||
"set termguicolors
|
" 'ctrl-t': Open in new tab (optional, common)
|
||||||
"colorscheme slate
|
" 'ctrl-p': Paste raw filename(s) at cursor
|
||||||
"colorscheme marklar
|
" 'ctrl-l': Paste formatted [[wiki link]] at cursor
|
||||||
"colorscheme automation
|
" NOTE: Define these functions BEFORE they are used in g:fzf_action below.
|
||||||
colorscheme advantage
|
|
||||||
|
|
||||||
"highlight colorcolumn ctermbg=darkyellow guibg=darkyellow
|
" Function to paste FZF selection(s) at the current cursor position
|
||||||
"highlight VertSplit ctermbg=black guibg=black ctermfg=darkgray guifg=darkgray
|
function! PasteFzfSelection(lines)
|
||||||
highlight cursorcolumn cterm=NONE ctermbg=black ctermfg=white guibg=darkred guifg=white
|
if type(a:lines) != type([]) || empty(a:lines)
|
||||||
"highlight visual cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
|
echoerr "FZF Paste Error: No selection passed to function PasteFzfSelection."
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
" Join multiple selections with a space
|
||||||
|
let text_to_paste = join(a:lines, ' ')
|
||||||
|
" Insert the text
|
||||||
|
call feedkeys('i' . text_to_paste . "\<esc>", 'ni')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Function to paste FZF selection as a formatted wiki link
|
||||||
|
function! PasteFzfWikiLink(lines)
|
||||||
|
if type(a:lines) != type([]) || empty(a:lines)
|
||||||
|
echoerr "FZF Paste Error: No selection passed to function PasteFzfWikiLink."
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
" In split windows - active buffer status bar is yellow, inactive is black
|
" Typically you only link one file at a time
|
||||||
"hi statuslinenc ctermbg=gray ctermfg=black
|
let filename = a:lines[0]
|
||||||
"hi statusline ctermbg=yellow ctermfg=green
|
|
||||||
|
" --- CHOOSE YOUR LINK FORMAT ---
|
||||||
|
" Option 1: Wiki format [[filename_without_extension]]
|
||||||
|
"let filename_base = fnamemodify(filename, ':r') " Removes the extension
|
||||||
|
"let link_text = '[[' . filename_base . ']]'
|
||||||
|
|
||||||
|
" Option 2: Wiki format [[filename_with_extension]]
|
||||||
|
let link_text = '[[' . filename . ']]'
|
||||||
|
|
||||||
|
" Option 3: Markdown format [filename](filename)
|
||||||
|
" let link_text = '[' . filename . '](' . filename . ')'
|
||||||
|
" --- End Formatting Options ---
|
||||||
|
|
||||||
|
" Insert the formatted link
|
||||||
|
call feedkeys('i' . link_text . "\<esc>", 'ni')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let g:fzf_action = {
|
||||||
|
\ 'ctrl-x': 'split',
|
||||||
|
\ 'ctrl-v': 'vsplit',
|
||||||
|
\ 'ctrl-t': 'tab split',
|
||||||
|
\ 'ctrl-p': function('PasteFzfSelection'),
|
||||||
|
\ 'ctrl-l': function('PasteFzfWikiLink')
|
||||||
|
\ }
|
||||||
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
" => Statusline
|
" => Keymaps: Highlights
|
||||||
" Ideas from http://got-ravings.blogspot.com/2008/08/vim-pr0n-making-statuslines-that-own.html
|
|
||||||
|
|
||||||
set laststatus=2 " always show statusline
|
" <F6> to toggle search highlight
|
||||||
set statusline= " clear on reload
|
nnoremap <F6> :nohls <enter>
|
||||||
set statusline+=[\ b%n\ ] " buffer number
|
|
||||||
set statusline+=\ %f " filename
|
|
||||||
set statusline+=\ [%{strlen(&fenc)?&fenc:'none'}, " file encoding
|
|
||||||
set statusline+=\ %{&ff}] " file format
|
|
||||||
set statusline+=\ %y " filetype
|
|
||||||
set statusline+=\ %H\ %m\ %r\ %W " flags
|
|
||||||
set statusline+=%= " left/right separator
|
|
||||||
set statusline+=l:%l/%L " cursor line/total lines
|
|
||||||
set statusline+=\ c:%c " cursor column
|
|
||||||
set statusline+=\ %P " percent through file
|
|
||||||
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
" <F7> to toggle row/column highlight
|
||||||
" => Keymaps: Doing more things at once
|
nnoremap <F7> :set cursorline! cursorcolumn!<CR>
|
||||||
|
|
||||||
" turn off search highlight
|
|
||||||
nnoremap <leader><space> :nohls <enter>
|
|
||||||
" toggle row/column cursor
|
|
||||||
nnoremap <Leader>c :set cursorline! cursorcolumn!<CR>
|
|
||||||
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
" ==> Keymaps: Buffers & Panes
|
" ==> Keymaps: Buffers & Panes
|
||||||
|
|
||||||
" <ctrl>-H to move to previous BUFFER
|
" <ctrl>-arrow left/right to navigate BUFFERS
|
||||||
nnoremap <C-H> :bp <enter>
|
map <esc>[1;5D :bp <enter>
|
||||||
" <ctrl>-L to move to next BUFFER
|
map <esc>[1;5C :bn <enter>
|
||||||
nnoremap <C-L> :bn <enter>
|
|
||||||
" <ctrl>-J to move to lower PANE
|
|
||||||
nnoremap <C-J> <C-W><C-J>
|
|
||||||
" <ctrl>-K to move to upper PANE
|
|
||||||
nnoremap <C-K> <C-W><C-K>
|
|
||||||
|
|
||||||
" <leader>-s to save buffer
|
" <leader>b to open FZF buffers
|
||||||
nnoremap <Leader>s :w <enter>
|
map <leader>b :Buffers<CR>
|
||||||
" <leader>-c to close buffer
|
|
||||||
nnoremap <Leader>c :bd <enter>
|
|
||||||
|
|
||||||
" bring up the copy buffer
|
" <leader>m to open file marks
|
||||||
noremap <Leader>x "+
|
map <leader>m :Marks<CR>
|
||||||
" <F5> to refresh buffer
|
|
||||||
nnoremap <F5> <C-R>:checktime <CR>
|
" <leader>a to abandon buffer
|
||||||
|
nnoremap <leader>a :bd! <enter>
|
||||||
|
|
||||||
|
" <leader>c to close buffer
|
||||||
|
nnoremap <leader>c :bd <enter>
|
||||||
|
|
||||||
|
" <c-s> to save buffer
|
||||||
|
nnoremap <c-s> :w<CR>
|
||||||
|
|
||||||
|
" <alt>-arrow keys to navigate panes
|
||||||
|
" UP
|
||||||
|
map <esc>[1;3A <c-w><c-k>
|
||||||
|
" DOWN
|
||||||
|
map <esc>[1;3B <c-w><c-j>
|
||||||
|
" LEFT
|
||||||
|
map <esc>[1;3D <c-w><c-h>
|
||||||
|
" RIGHT
|
||||||
|
map <esc>[1;3C <c-w><c-l>
|
||||||
|
" CLOSE
|
||||||
|
map <esc>x <c-w>q
|
||||||
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
" ==> Keymaps: With ripgrep and FZF
|
" ==> Keymaps
|
||||||
|
|
||||||
" <leader> f to open files
|
" <leader><leader> to open FZF files
|
||||||
map <Leader>f :Files<CR>
|
map <leader><leader> :Files<CR>
|
||||||
" search buffers
|
|
||||||
nmap ; :Buffers<CR>
|
" <leader>g to open FZF Git files
|
||||||
|
map <leader>g :GFiles<CR>
|
||||||
|
|
||||||
|
" Map <leader>f to open FZF with word under cursor pre-populated
|
||||||
|
" https://github.com/junegunn/fzf.vim/issues/1235#issuecomment-773726008
|
||||||
|
nnoremap <leader>f :call fzf#run(fzf#vim#with_preview(fzf#wrap({'source': 'find . \( -name .git -o -name .stversions \) -prune -o -print -iname "*'.expand("<cword>").'*"', 'sink': 'e', 'options': '--query="'.expand("<cword>").'"'})))<CR>
|
||||||
|
|
||||||
|
" Toggles line wrapping with linebreak enabled when wrapping is turned on with <leader>w
|
||||||
|
nnoremap <leader>w :execute "if &wrap\n set nowrap\nelse\n set wrap linebreak\nendif"<CR>
|
||||||
|
|
||||||
|
" Toggle line numbers
|
||||||
|
nnoremap <leader>n :set number! relativenumber! <CR>
|
||||||
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
" ==> Keymaps: Text bubbling (http://vimcasts.org/episodes/bubbling-text/)
|
" ==> Keymaps: Text bubbling (http://vimcasts.org/episodes/bubbling-text/)
|
||||||
|
|
||||||
" Bubble single lines
|
" Bubble single lines
|
||||||
nmap <C-k> ddkP
|
nmap <c-k> ddkP
|
||||||
nmap <C-j> ddp
|
nmap <c-j> ddp
|
||||||
" Bubble multiple lines
|
|
||||||
vmap <C-k> xkP`[V`]
|
" Bubble multiple lines
|
||||||
vmap <C-j> xp`[V`]
|
vmap <c-k> xkP`[V`]
|
||||||
|
vmap <c-j> xp`[V`]
|
||||||
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
" ==> Keymaps: More sane movement keys
|
" ==> Keymaps: Movement keys
|
||||||
|
|
||||||
|
" Navigate according to displayed lines, not physical lines
|
||||||
nnoremap j gj
|
nnoremap j gj
|
||||||
nnoremap k gk
|
nnoremap k gk
|
||||||
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
" ==> Keymaps: Date and Time stamps
|
" ==> Keymaps: Date and Time stamps
|
||||||
|
|
||||||
|
" Send date and time
|
||||||
imap <F2> <C-R>=strftime("%Y-%m-%d %H:%M:%S")<CR>
|
imap <F2> <C-R>=strftime("%Y-%m-%d %H:%M:%S")<CR>
|
||||||
imap <F3> <C-R>=strftime("%Y-%m-%d %a")<CR>
|
|
||||||
imap <F4> <C-R>=strftime("%H:%M")<CR>
|
|
||||||
|
|
||||||
|
" Send date and DOW
|
||||||
|
imap <F3> <C-R>=strftime("%Y-%m-%d %a")<CR>
|
||||||
|
" alternate keybinding I use in VS Code
|
||||||
|
imap <C-S-i> <C-R>=strftime("%Y-%m-%d %a")<CR>
|
||||||
|
|
||||||
|
" Sends date
|
||||||
|
imap <F4> <C-R>=strftime("%Y-%m-%d")<CR>
|
||||||
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
" ==> Spellcheck
|
" ==> Spellcheck
|
||||||
" Horrible colors! I hate spellchecker's red highlight, so I changed it
|
|
||||||
" (http://stackoverflow.com/questions/6008921/how-do-i-change-the-highlight-style-in-vim-spellcheck)
|
|
||||||
" Vim Colors: (http://alvinalexander.com/linux/vi-vim-editor-color-scheme-syntax)
|
|
||||||
|
|
||||||
" Toggle spell check with F10
|
" auto-complete spelling suggestions with <ctrl-p>
|
||||||
|
set complete+=kspell
|
||||||
|
|
||||||
|
autocmd FileType markdown setlocal complete+=kspell
|
||||||
|
autocmd FileType text setlocal complete+=kspell
|
||||||
|
autocmd FileType gitcommit setlocal complete+=kspell
|
||||||
|
|
||||||
|
" Toggle spell check highlights with <F10>
|
||||||
nnoremap <F10> :setlocal spell! spelllang=en_us<CR>
|
nnoremap <F10> :setlocal spell! spelllang=en_us<CR>
|
||||||
set spell spelllang=en_us
|
|
||||||
" Save custom dictionary in nextcloud so it's available on all machines
|
" ==> Spellcheck: only certain file types
|
||||||
" set spellfile=/home/chawley/nextcloud-overlook/notes/system/en.utf-8.add
|
" https://robots.thoughtbot.com/vim-spell-checking
|
||||||
|
|
||||||
|
" turn on for markdown files
|
||||||
|
autocmd BufRead,BufNewFile *.md setlocal spell
|
||||||
|
|
||||||
|
" turn on for text files
|
||||||
|
autocmd BufRead,BufNewFile *.txt setlocal spell
|
||||||
|
|
||||||
|
" turn on for git commits
|
||||||
|
autocmd FileType gitcommit setlocal spell spelllang=en_us
|
||||||
|
|
||||||
|
" ==> Spellcheck Colors
|
||||||
|
"
|
||||||
|
" I hate spellcheck's default colors
|
||||||
|
" (http://stackoverflow.com/questions/6008921/how-do-i-change-the-highlight-style-in-vim-spellcheck)
|
||||||
|
" Vim Colors: (http://alvinalexander.com/linux/vi-vim-editor-color-scheme-syntax)
|
||||||
hi clear SpellBad
|
hi clear SpellBad
|
||||||
hi clear SpellCap
|
hi clear SpellCap
|
||||||
hi clear SpellErrors
|
|
||||||
hi clear SpellLocal
|
hi clear SpellLocal
|
||||||
hi clear SpellRare
|
hi clear SpellRare
|
||||||
hi SpellBad cterm=underline ctermbg=black ctermfg=red
|
hi SpellCap cterm=underline ctermbg=none
|
||||||
hi SpellCap cterm=underline ctermbg=black ctermfg=red
|
hi SpellBad cterm=underline ctermbg=none
|
||||||
|
hi SpellLocal cterm=underline ctermbg=none
|
||||||
|
hi SpellRare cterm=underline ctermbg=none
|
||||||
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
" ==> Spellcheck: only certain file types https://robots.thoughtbot.com/vim-spell-checking
|
" ==> Templates: markdown documents with frontmatter (.md)
|
||||||
|
|
||||||
" turn off for files with no extension
|
|
||||||
autocmd BufRead,BufNewFile * setlocal nospell
|
|
||||||
" turn off for files with any extension
|
|
||||||
autocmd BufRead,BufNewFile *.* setlocal nospell
|
|
||||||
" turn on for markdown files
|
|
||||||
autocmd BufRead,BufNewFile *.md setlocal spell
|
|
||||||
" turn on for text files
|
|
||||||
autocmd BufRead,BufNewFile *.txt setlocal spell
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
" ==> Snippets
|
|
||||||
" Pasting pre-made things
|
|
||||||
|
|
||||||
" section banner
|
|
||||||
nnoremap ,ban :-1read $HOME/.vim/templates/banner<CR>jA
|
|
||||||
|
|
||||||
" section begin/end
|
|
||||||
nnoremap ,begend :-1read $HOME/.vim/templates/begend<CR>jA
|
|
||||||
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
|
||||||
" ==> Templates
|
|
||||||
" Doing special things with certain filetypes
|
|
||||||
|
|
||||||
|
autocmd BufNewFile *.md so $HOME/.vim/templates/mdfm
|
||||||
|
autocmd BufNewFile *.md exe "g/^filecreated:.*/s//filecreated: " .strftime("%Y-%m-%d")
|
||||||
|
autocmd BufNewFile *.md exe "normal Go"
|
||||||
|
autocmd BufWritePre,filewritepre *.md execute "normal! ma"
|
||||||
|
autocmd BufWritePre,filewritepre *.md exe "g/^fileupdated:.*/s//fileupdated: " .strftime("%Y-%m-%d")
|
||||||
|
autocmd BufWritePost,filewritepost *.md execute "normal! `a"
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
" ==> Templates: shell scripts (.sh)
|
" ==> Templates: shell scripts (.sh)
|
||||||
|
|
||||||
autocmd BufNewFile *.sh so $HOME/.vim/templates/sh
|
autocmd BufNewFile *.sh so $HOME/.vim/templates/sh
|
||||||
autocmd BufNewFile *.sh %s/FILE:.*/\='FILE: '.expand('%:t')/e
|
autocmd BufNewFile *.sh :%s/filename/\=expand('%:t:r')/g
|
||||||
autocmd BufNewFile *.sh exe "g/AUTHOR:.*/s//AUTHOR: C Hawley"
|
|
||||||
autocmd BufNewFile *.sh exe "g/CREATED:.*/s//CREATED: " .strftime("%Y-%m-%d")
|
autocmd BufNewFile *.sh exe "g/CREATED:.*/s//CREATED: " .strftime("%Y-%m-%d")
|
||||||
|
autocmd BufNewFile *.sh exe "normal Go"
|
||||||
autocmd BufWritePre,filewritepre *.sh execute "normal ma"
|
autocmd BufWritePre,filewritepre *.sh execute "normal ma"
|
||||||
autocmd BufWritePre,filewritepre *.sh exe "g/REVISION:.*/s//REVISION: " .strftime("%Y-%m-%d")
|
autocmd BufWritePre,filewritepre *.sh exe "g/UPDATED:.*/s//UPDATED: " .strftime("%Y-%m-%d")
|
||||||
autocmd bufWritePost,filewritepost *.sh execute "normal `a"
|
autocmd bufWritePost,filewritepost *.sh execute "normal `a"
|
||||||
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
" ==> Templates: python scripts (.py)
|
" ==> Snippets
|
||||||
|
" Pasting pre-made things
|
||||||
|
|
||||||
autocmd BufNewFile *.py so $HOME/.vim/templates/py
|
" section banner
|
||||||
autocmd BufNewFile *.py %s/FILE:.*/\='FILE: '.expand('%')/e
|
nnoremap ,ban :-1read $HOME/.vim/templates/banner<CR>jA
|
||||||
autocmd BufNewFile *.py exe "g/AUTHOR:.*/s//AUTHOR: C Hawley"
|
|
||||||
autocmd BufNewFile *.py exe "g/CREATED:.*/s//CREATED: " .strftime("%c")
|
" section begin/end
|
||||||
autocmd BufWritePre,filewritepre *.py execute "normal ma"
|
nnoremap ,begend :-1read $HOME/.vim/templates/begend<CR>jA
|
||||||
autocmd BufWritePre,filewritepre *.py exe "g/REVISION:.*/s//REVISION: " .strftime("%c")
|
|
||||||
autocmd bufWritePost,filewritepost *.py execute "normal `a"
|
" section shell script header
|
||||||
|
nnoremap ,sh :0read $HOME/.vim/templates/sh<CR> <bar> :1<CR>dd <bar> :4%s/filename/\=expand('%:t')/g<CR>
|
||||||
|
|
||||||
|
" section readinglist header
|
||||||
|
nnoremap ,rl :0read $HOME/.vim/templates/rlfm<CR> <bar>zR<CR> <bar> :1<CR>dd
|
||||||
|
|
||||||
|
" section markdown file header
|
||||||
|
nnoremap ,md :0read $HOME/.vim/templates/mdfm<CR> <bar>zR<CR> <bar> :1<CR>dd
|
||||||
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
" ==> Templates: markdown documents (.md, .mkd)
|
" ==> NetrwTreeListing readonly fix (https://vi.stackexchange.com/a/13012)
|
||||||
|
" Per default, netrw leaves unmodified buffers open. This autocommand
|
||||||
|
" deletes netrw's buffer once it's hidden (using ':q', for example)
|
||||||
|
|
||||||
autocmd BufNewFile *.md,*.mkd so $HOME/.vim/templates/md
|
|
||||||
autocmd BufNewFile *.md,*.mkd %s/title.*/\=''.expand('%:r')/e
|
|
||||||
autocmd BufWritePre,filewritepre *.md,*.mkd execute "normal ma"
|
|
||||||
autocmd BufWritePre,filewritepre *.md,*.mkd exe "g/Updated:.*/s//Updated: " .strftime("%Y-%m-%d %H:%M")
|
|
||||||
autocmd bufWritePost,filewritepost *.md,*.mkd execute "normal `a"
|
|
||||||
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
|
||||||
" ==> netrw - NERDtree like setup (https://shapeshed.com/vim-netrw/)
|
|
||||||
|
|
||||||
let g:netrw_banner = 0
|
|
||||||
let g:netrw_liststyle = 3
|
|
||||||
let g:netrw_browse_split = 4
|
|
||||||
let g:netrw_altv = 1
|
|
||||||
let g:netrw_winsize = 25
|
|
||||||
|
|
||||||
" NetrwTreeListing readonly fix. (https://vi.stackexchange.com/a/13012)
|
|
||||||
" Per default, netrw leaves unmodified buffers open. This autocommand
|
|
||||||
" deletes netrw's buffer once it's hidden (using ':q', for example)
|
|
||||||
autocmd FileType netrw setl bufhidden=delete
|
autocmd FileType netrw setl bufhidden=delete
|
||||||
|
|
||||||
" ---------------------------------------------------------------------------------------------------------------------
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
" ==> yaml stuff (https://lornajane.net/posts/2018/vim-settings-for-working-with-yaml)
|
" ==> yaml stuff (https://lornajane.net/posts/2018/vim-settings-for-working-with-yaml)
|
||||||
"
|
"
|
||||||
autocmd BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml
|
autocmd BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml foldmethod=manual
|
||||||
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
|
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
|
||||||
|
|
||||||
|
" Abbreviations
|
||||||
|
" Correcting common misspellings
|
||||||
|
iab couljd could
|
||||||
|
iab wouljd would
|
||||||
|
iab monring morning
|
||||||
|
iab teh the
|
||||||
|
iab adn and
|
||||||
|
iab form from
|
||||||
|
iab wiht with
|
||||||
|
iab becuase because
|
||||||
|
iab definately definitely
|
||||||
|
iab seperate separate
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
|
" ==> Colors
|
||||||
|
" Term GUI Colors
|
||||||
|
" colorscheme replaced by ~/.vimcustom
|
||||||
|
" If there is a file at ~/.vimcustom, the colorscheme defined in that file
|
||||||
|
" will be applied. If not, colorscheme defaults to 'darkburn'
|
||||||
|
" ---------------------------------------------------------------------------------------------------------------------
|
||||||
|
" ==> Source Local Customizations and Set Colorscheme
|
||||||
|
|
||||||
|
let s:custom_config_path = expand('$HOME/.vimcustom')
|
||||||
|
|
||||||
|
if filereadable(s:custom_config_path)
|
||||||
|
execute 'source' fnameescape(s:custom_config_path)
|
||||||
|
else
|
||||||
|
colorscheme darkburn
|
||||||
|
endif
|
||||||
|
|||||||
133
CHANGELOG.md
Normal file
133
CHANGELOG.md
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
# Last 25 Commits
|
||||||
|
## 9dbe4a8 (chawley (penguin), 2025-04-24) - Disable folding for yaml
|
||||||
|
|
||||||
|
Disable fold for yaml files
|
||||||
|
|
||||||
|
|
||||||
|
## b052f7f (chawley (overlook), 2025-04-23) - Added line number toggle and colorscheme customization
|
||||||
|
|
||||||
|
- <leader>n to toggle line numbers
|
||||||
|
- source ~/.vimcustom (if exists) for custom colorscheme
|
||||||
|
- disable airline theme (let it inherit from colorscheme
|
||||||
|
-
|
||||||
|
|
||||||
|
|
||||||
|
## fe39e86 (chawley (penguin), 2025-04-20) - added words to dictionary
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## aaf5d31 (chawley (overlook), 2025-04-15) - Reworked Spell Check Section
|
||||||
|
|
||||||
|
Removed the global nospell autocommands:
|
||||||
|
The lines `autocmd BufRead,BufNewFile * setlocal nospell` and
|
||||||
|
`autocmd BufRead,BufNewFile *.* setlocal nospell` have been removed.
|
||||||
|
These were turning off spell checking for all files.
|
||||||
|
|
||||||
|
|
||||||
|
## d2821c7 (chawley (overlook), 2025-04-14) - .vimrc changes
|
||||||
|
|
||||||
|
- Theme: darkburn
|
||||||
|
- ASCII foldchars
|
||||||
|
- Changed keybinding for notes to `<leader>nn`
|
||||||
|
-
|
||||||
|
|
||||||
|
|
||||||
|
## 750376d (phansible, 2025-04-14) - Added no line break to wrap toggle
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 0793816 (chawley (tfadmin), 2025-04-14) - Updated README
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 063e68f (chawley (tfadmin), 2025-04-14) - Added marks list
|
||||||
|
|
||||||
|
Keybinding (`<leader>m`) to open mark list
|
||||||
|
|
||||||
|
|
||||||
|
## c63cb6a (chawley (overlook), 2025-04-14) - Added keybinding for datestamp
|
||||||
|
|
||||||
|
Added additional keybinding to mimic datestamp entry from VS Code (<crtl><shift>-i)
|
||||||
|
|
||||||
|
|
||||||
|
## a2c808e (chawley (overlook), 2025-04-14) - Added words to custom dictionary
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 41a036f (chawley (overlook), 2025-04-14) - Updated README
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 48dd076 (chawley (overlook), 2025-04-14) - Upgraded vim-plug plugin
|
||||||
|
|
||||||
|
via :PlugUpgrade
|
||||||
|
|
||||||
|
|
||||||
|
## b2bacfa (chawley (overlook), 2025-04-14) - .vimrc and rm old templates
|
||||||
|
|
||||||
|
Removed unused templates, added word-wrap to .vimrc
|
||||||
|
|
||||||
|
|
||||||
|
## 6db5468 (chawley (tfadmin), 2024-10-28) - Updated vim-plug plugin
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 6372ff4 (chawley, 2024-05-21) - text width = 135
|
||||||
|
|
||||||
|
Increased text width to 135 by default.
|
||||||
|
|
||||||
|
|
||||||
|
## 89fdfb9 (chawley, 2024-05-09) - Changed keybinding for FZF paste
|
||||||
|
|
||||||
|
Press <ctrl>-p to paste the filename of the file selected by FZF
|
||||||
|
|
||||||
|
|
||||||
|
## f4f82ad (chawley, 2024-05-03) - .vimrc - removed reference to filenames in markdown frontmatter
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 97f7d50 (chawley, 2024-05-03) - Markdown Frontmatter
|
||||||
|
|
||||||
|
I removed the filename from markdown frontmatter. I've renamed file and
|
||||||
|
the filename in the frontmatter doesn't update. That's a recipe for
|
||||||
|
confusion later
|
||||||
|
|
||||||
|
|
||||||
|
## 244c5ed (chawley, 2024-04-24) - Added words to custom dictionary
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 67569b9 (chawley, 2024-04-23) - Added link to ref for
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 91e5cd5 (chawley, 2024-04-23) - Leader-f to fuzzy search word under cursor
|
||||||
|
|
||||||
|
`<leader>-f` to open FZF window with word under cursor pre-populated
|
||||||
|
|
||||||
|
|
||||||
|
## 0fa0c06 (chawley, 2024-04-16) - Frontmatter for readinglist
|
||||||
|
|
||||||
|
Reverted readinglist frontmatter to standard format with yaml delimiters
|
||||||
|
and bracketed tags
|
||||||
|
|
||||||
|
|
||||||
|
## d0cfda7 (chawley, 2024-04-15) - Frontmatter tag format
|
||||||
|
|
||||||
|
Frontmatter tags should be a list (in brackets). If I'm going to do
|
||||||
|
this, I may as well do it right.
|
||||||
|
|
||||||
|
|
||||||
|
## 5669fb2 (chawley, 2024-04-15) - Re-added proper frontmatter to markdown template
|
||||||
|
|
||||||
|
I'd removed the hashmarks from the markdown frontmatte tempplate so I
|
||||||
|
could use tags in SilverBullet, but decided against using SilverBullet
|
||||||
|
regularly. Not enough to break proper formatting.
|
||||||
|
|
||||||
|
|
||||||
|
## 2784a69 (chawley, 2024-04-10) - Removed timestamps from Markdown Files
|
||||||
|
|
||||||
|
I removed the time from markdown `fileupdated` datestamps. I don't need
|
||||||
|
that level of reference. The date a file was updated is fine.
|
||||||
|
|
||||||
|
|
||||||
25
README.md
25
README.md
@@ -1,16 +1,23 @@
|
|||||||
|
---
|
||||||
|
filecreated:
|
||||||
|
fileupdated: 2025-04-24
|
||||||
|
filetags: [readme]
|
||||||
|
---
|
||||||
|
|
||||||
# dotfiles-vim
|
# dotfiles-vim
|
||||||
|
|
||||||
Breaking this out of my dotfiles repo to try to get a handle on multiple configurations from multiple machines.
|
I want to finally have a `.vimrc` in which I understand each and every line. After years of collecting snips and scraps from other people's dotfiles, I want to make sure that I am aware of what my `.vimrc` is doing.
|
||||||
|
|
||||||
I also want to finally have a `.vimrc` in which I understand each and every line. After years of collecting snips and
|
This configuration is based heavily on the guide I found here: [Vim Zero](https://www.oliversherouse.com/posts/vim_zero.html) which does exactly what I am aiming to do here: wipe the slate clean and start over.
|
||||||
scraps from other people's dotfiles, I want to make sure that I am aware of what my `.vimrc` is doing.
|
|
||||||
|
|
||||||
This configuration is based heavily on the guide I found here: [Vim
|
Whenever possible, I've noted the URL from which I found the setting or snippet. I try to insist that not everything is self-explanatory.
|
||||||
Zero](https://www.oliversherouse.com/2017/08/21/vim_zero.html) which does exactly what I am aiming to do here: wipe the
|
|
||||||
slate clean and start over.
|
|
||||||
|
|
||||||
Whenever possible, I've noted the URL from which I found the setting or snippet. I try to insist that not everything
|
## Installation
|
||||||
is self-explanatory.
|
|
||||||
|
|
||||||
* 2020-02-13: migrated repo to castlerock
|
Clone this repo to a directory and run the `create-links.sh` script. CAUTION: this will remove any existing `.vimrc` and `.vim` directories and replace them with soft links to the files in this repository.
|
||||||
|
|
||||||
|
Then open vim and install (or update) the plugins with `:PlugInstall` (or `:PlugUpdate`)
|
||||||
|
|
||||||
|
## Changelog
|
||||||
|
|
||||||
|
Moved to CHANGELOG.md
|
||||||
|
|||||||
23
create-links.sh
Executable file
23
create-links.sh
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#===============================================================================
|
||||||
|
#
|
||||||
|
# FILE: create-symlinks.sh
|
||||||
|
# USAGE:
|
||||||
|
# DESCRIPTION:
|
||||||
|
# REQUIREMENTS:
|
||||||
|
# NOTES:
|
||||||
|
# AUTHOR: C Hawley
|
||||||
|
# CREATED:
|
||||||
|
#
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
# If regular files exists, remove them
|
||||||
|
[[ -f $HOME/.vimrc ]] && rm $HOME/.vimrc
|
||||||
|
[[ -d $HOME/.vim ]] && rm $HOME/.vim
|
||||||
|
|
||||||
|
# If symlinks exist, unlink them
|
||||||
|
[[ -L $HOME/.vimrc ]] && unlink $HOME/.vimrc
|
||||||
|
[[ -L $HOME/.vim ]] && unlink $HOME/.vim
|
||||||
|
|
||||||
|
ln -s $PWD/.vimrc $HOME/.vimrc
|
||||||
|
ln -s $PWD/.vim $HOME/.vim
|
||||||
Reference in New Issue
Block a user