First commit

This commit is contained in:
Mikkel Svartveit 2023-03-21 16:31:37 +01:00
commit 6009c4e36d
17 changed files with 2254 additions and 0 deletions

16
.gitignore vendored Normal file
View file

@ -0,0 +1,16 @@
# Ignore everything by default
*
!*/
# Whitelist certain files and directories
!.gitignore
!iterm2-preferences/**/*
!fish/config.fish
!git/**/*
!vim/**/*
!nvim/**/*
!vscode-neovim/**/*
!karabiner/**/*
# Blacklist some stuff again
.DS_Store

68
fish/config.fish Normal file
View file

@ -0,0 +1,68 @@
alias conf="git --git-dir=$HOME/.myconfig.git/ --work-tree=$HOME"
alias fixmouse="killall LogiMgrDaemon"
alias icloud="cd ~/Library/Mobile\ Documents/com~apple~CloudDocs"
alias pi="ssh pi@185.138.33.80 -p 1733"
alias zshrc="nvim ~/.zshrc"
alias fishconfig="cd ~/.config/fish && nvim config.fish && cd -"
alias nvimconfig="cd ~/.config/nvim && nvim && cd -"
alias ai="sgpt -se"
alias y="open -a Yoink"
abbr x86 "arch -x86_64"
abbr f "fuck"
abbr v "nvim"
abbr ghv "gh repo view --web"
abbr pr "gh pr checkout"
abbr prc "gh pr create --web"
function ghid
gh issue develop $argv[1] --checkout --name $argv[2]
end
# Print the directory of the top-most Finder window
function pfd
bass "echo \"`osascript -e 'tell application \"Finder\" to POSIX path of (insertion location as alias)' end tell`\""
end
# cd to the directory of the top-most Finder window
function cdf
cd $(pfd)
end
# Open a file with macOS Quick Look
function ql
qlmanage -p $argv >/dev/null &
end
# Start Docker Desktop and wait to ensure the daemon is ready
function ds
echo "Launching Docker Daemon..."
open -a "Docker"
sleep 15
echo "Docker daemon started."
end
function dq
osascript -e 'quit app "Docker Desktop"'
end
# Initialize nvm through bass
bass source ~/.nvm/nvm.sh ';'
function nvm
bass source ~/.nvm/nvm.sh --no-use ';' nvm $argv
end
# Enable autojump
[ -f /opt/homebrew/share/autojump/autojump.fish ]; and source /opt/homebrew/share/autojump/autojump.fish
# Initialize fuck
thefuck --alias | source
# Allow running pip packages
export PATH="/Users/mikkelsvartveit/Library/Python/3.9/bin:$PATH"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
eval /Users/mikkelsvartveit/opt/anaconda3/bin/conda "shell.fish" "hook" $argv | source
# <<< conda initialize <<<

10
git/config Normal file
View file

@ -0,0 +1,10 @@
[user]
name = Mikkel Svartveit
email = mikkel.svartveit@gmail.com
[core]
excludesfile = ~/.config/gitignore_global
editor = nvim
[init]
defaultBranch = main
[pull]
rebase = true

2
git/gitignore_global Normal file
View file

@ -0,0 +1,2 @@
.DS_Store
.vim

View file

@ -0,0 +1,828 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AllowClipboardAccess</key>
<false/>
<key>Command</key>
<string></string>
<key>CopySelection</key>
<true/>
<key>Default Bookmark Guid</key>
<string>176CC3A0-7519-4F56-A9CA-A13581E4DE4E</string>
<key>DoubleClickPerformsSmartSelection</key>
<false/>
<key>EnableDivisionView</key>
<false/>
<key>HapticFeedbackForEsc</key>
<false/>
<key>HideScrollbar</key>
<true/>
<key>HideTab</key>
<true/>
<key>HotkeyMigratedFromSingleToMulti</key>
<true/>
<key>New Bookmarks</key>
<array>
<dict>
<key>ASCII Anti Aliased</key>
<true/>
<key>ASCII Ligatures</key>
<true/>
<key>Ambiguous Double Width</key>
<false/>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.203921568627</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.17254901960800001</real>
<key>Red Component</key>
<real>0.15686274509799999</real>
</dict>
<key>Ansi 1 Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.458823529412</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.42352941176499997</real>
<key>Red Component</key>
<real>0.87843137254899994</real>
</dict>
<key>Ansi 10 Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.47450980392199998</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.76470588235299997</real>
<key>Red Component</key>
<real>0.59607843137299998</real>
</dict>
<key>Ansi 11 Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.48235294117600003</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.75294117647100001</real>
<key>Red Component</key>
<real>0.89803921568599998</real>
</dict>
<key>Ansi 12 Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.93725490196100003</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.68627450980399995</real>
<key>Red Component</key>
<real>0.38039215686299999</real>
</dict>
<key>Ansi 13 Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.86666666666699999</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.47058823529400001</real>
<key>Red Component</key>
<real>0.77647058823500004</real>
</dict>
<key>Ansi 14 Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.76078431372499999</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.71372549019599996</real>
<key>Red Component</key>
<real>0.337254901961</real>
</dict>
<key>Ansi 15 Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.89411764705899999</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.87450980392199995</real>
<key>Red Component</key>
<real>0.86274509803900001</real>
</dict>
<key>Ansi 2 Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.47450980392199998</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.76470588235299997</real>
<key>Red Component</key>
<real>0.59607843137299998</real>
</dict>
<key>Ansi 3 Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.48235294117600003</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.75294117647100001</real>
<key>Red Component</key>
<real>0.89803921568599998</real>
</dict>
<key>Ansi 4 Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.93725490196100003</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.68627450980399995</real>
<key>Red Component</key>
<real>0.38039215686299999</real>
</dict>
<key>Ansi 5 Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.86666666666699999</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.47058823529400001</real>
<key>Red Component</key>
<real>0.77647058823500004</real>
</dict>
<key>Ansi 6 Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.76078431372499999</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.71372549019599996</real>
<key>Red Component</key>
<real>0.337254901961</real>
</dict>
<key>Ansi 7 Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.89411764705899999</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.87450980392199995</real>
<key>Red Component</key>
<real>0.86274509803900001</real>
</dict>
<key>Ansi 8 Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.56470588235294117</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.47843137254901963</real>
<key>Red Component</key>
<real>0.43529411764705883</real>
</dict>
<key>Ansi 9 Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.458823529412</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.42352941176499997</real>
<key>Red Component</key>
<real>0.87843137254899994</real>
</dict>
<key>BM Growl</key>
<true/>
<key>Background Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.20392156862745098</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.17254901960784313</real>
<key>Red Component</key>
<real>0.15686274509803921</real>
</dict>
<key>Background Image Location</key>
<string></string>
<key>Badge Color</key>
<dict>
<key>Alpha Component</key>
<real>0.5</real>
<key>Blue Component</key>
<integer>0</integer>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<integer>0</integer>
<key>Red Component</key>
<integer>1</integer>
</dict>
<key>Blinking Cursor</key>
<false/>
<key>Blur</key>
<false/>
<key>Blur Radius</key>
<real>0.10000000000000001</real>
<key>Bold Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.74901962280273438</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.69803923368453979</real>
<key>Red Component</key>
<real>0.67058825492858887</real>
</dict>
<key>Bound Hosts</key>
<array/>
<key>Brighten Bold Text</key>
<true/>
<key>Character Encoding</key>
<integer>4</integer>
<key>Close Sessions On End</key>
<true/>
<key>Columns</key>
<integer>100</integer>
<key>Command</key>
<string></string>
<key>Cursor Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.80000000000000004</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.701960784314</real>
<key>Red Component</key>
<real>0.63921568627500003</real>
</dict>
<key>Cursor Guide Color</key>
<dict>
<key>Alpha Component</key>
<real>0.25</real>
<key>Blue Component</key>
<real>0.25098039215700002</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.211764705882</real>
<key>Red Component</key>
<real>0.19215686274499999</real>
</dict>
<key>Cursor Text Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.89411764705899999</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.87450980392199995</real>
<key>Red Component</key>
<real>0.86274509803900001</real>
</dict>
<key>Cursor Type</key>
<integer>1</integer>
<key>Custom Command</key>
<string>No</string>
<key>Custom Directory</key>
<string>Recycle</string>
<key>Default Bookmark</key>
<string>No</string>
<key>Description</key>
<string>Default</string>
<key>Disable Window Resizing</key>
<true/>
<key>Flashing Bell</key>
<false/>
<key>Foreground Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.89411764705899999</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.87450980392199995</real>
<key>Red Component</key>
<real>0.86274509803900001</real>
</dict>
<key>Guid</key>
<string>176CC3A0-7519-4F56-A9CA-A13581E4DE4E</string>
<key>Horizontal Spacing</key>
<real>1</real>
<key>Idle Code</key>
<integer>0</integer>
<key>Jobs to Ignore</key>
<array>
<string>rlogin</string>
<string>ssh</string>
<string>slogin</string>
<string>telnet</string>
</array>
<key>Keyboard Map</key>
<dict>
<key>0x2d-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1f</string>
</dict>
<key>0x32-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x00</string>
</dict>
<key>0x33-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1b</string>
</dict>
<key>0x34-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1c</string>
</dict>
<key>0x35-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1d</string>
</dict>
<key>0x36-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1e</string>
</dict>
<key>0x37-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1f</string>
</dict>
<key>0x38-0x40000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x7f</string>
</dict>
<key>0xf700-0x220000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2A</string>
</dict>
<key>0xf700-0x240000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5A</string>
</dict>
<key>0xf700-0x260000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;6A</string>
</dict>
<key>0xf700-0x280000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1b 0x1b 0x5b 0x41</string>
</dict>
<key>0xf701-0x220000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2B</string>
</dict>
<key>0xf701-0x240000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5B</string>
</dict>
<key>0xf701-0x260000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;6B</string>
</dict>
<key>0xf701-0x280000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1b 0x1b 0x5b 0x42</string>
</dict>
<key>0xf702-0x220000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2D</string>
</dict>
<key>0xf702-0x240000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5D</string>
</dict>
<key>0xf702-0x260000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;6D</string>
</dict>
<key>0xf702-0x280000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1b 0x1b 0x5b 0x44</string>
</dict>
<key>0xf703-0x220000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2C</string>
</dict>
<key>0xf703-0x240000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5C</string>
</dict>
<key>0xf703-0x260000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;6C</string>
</dict>
<key>0xf703-0x280000</key>
<dict>
<key>Action</key>
<integer>11</integer>
<key>Text</key>
<string>0x1b 0x1b 0x5b 0x43</string>
</dict>
<key>0xf704-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2P</string>
</dict>
<key>0xf705-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2Q</string>
</dict>
<key>0xf706-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2R</string>
</dict>
<key>0xf707-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2S</string>
</dict>
<key>0xf708-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[15;2~</string>
</dict>
<key>0xf709-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[17;2~</string>
</dict>
<key>0xf70a-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[18;2~</string>
</dict>
<key>0xf70b-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[19;2~</string>
</dict>
<key>0xf70c-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[20;2~</string>
</dict>
<key>0xf70d-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[21;2~</string>
</dict>
<key>0xf70e-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[23;2~</string>
</dict>
<key>0xf70f-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[24;2~</string>
</dict>
<key>0xf729-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2H</string>
</dict>
<key>0xf729-0x40000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5H</string>
</dict>
<key>0xf72b-0x20000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;2F</string>
</dict>
<key>0xf72b-0x40000</key>
<dict>
<key>Action</key>
<integer>10</integer>
<key>Text</key>
<string>[1;5F</string>
</dict>
</dict>
<key>Link Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.93725490196100003</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.68627450980399995</real>
<key>Red Component</key>
<real>0.38039215686299999</real>
</dict>
<key>Mouse Reporting</key>
<true/>
<key>Name</key>
<string>Custom</string>
<key>Non Ascii Font</key>
<string>Monaco 12</string>
<key>Non-ASCII Anti Aliased</key>
<true/>
<key>Normal Font</key>
<string>FiraCodeNerdFontComplete-Retina 13</string>
<key>Only The Default BG Color Uses Transparency</key>
<false/>
<key>Option Key Sends</key>
<integer>0</integer>
<key>Prompt Before Closing 2</key>
<integer>2</integer>
<key>Right Option Key Sends</key>
<integer>0</integer>
<key>Rows</key>
<integer>24</integer>
<key>Screen</key>
<integer>-1</integer>
<key>Scrollback Lines</key>
<integer>1000</integer>
<key>Selected Text Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.89411764705899999</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.87450980392199995</real>
<key>Red Component</key>
<real>0.86274509803900001</real>
</dict>
<key>Selection Color</key>
<dict>
<key>Alpha Component</key>
<integer>1</integer>
<key>Blue Component</key>
<real>0.364705882353</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.30588235294100002</real>
<key>Red Component</key>
<real>0.27843137254900002</real>
</dict>
<key>Send Code When Idle</key>
<false/>
<key>Shortcut</key>
<string></string>
<key>Silence Bell</key>
<true/>
<key>Sync Title</key>
<false/>
<key>Tags</key>
<array/>
<key>Terminal Type</key>
<string>xterm-256color</string>
<key>Thin Strokes</key>
<integer>0</integer>
<key>Transparency</key>
<integer>0</integer>
<key>Unlimited Scrollback</key>
<false/>
<key>Use Bold Font</key>
<true/>
<key>Use Bright Bold</key>
<true/>
<key>Use Italic Font</key>
<true/>
<key>Use Non-ASCII Font</key>
<false/>
<key>Vertical Spacing</key>
<real>1.25</real>
<key>Visual Bell</key>
<false/>
<key>Window Type</key>
<integer>0</integer>
<key>Working Directory</key>
<string>/Users/mikkelsvartveit</string>
</dict>
</array>
<key>OpenNewWindowAtStartup</key>
<true/>
<key>PMPrintingExpandedStateForPrint2</key>
<false/>
<key>PointerActions</key>
<dict>
<key>Button,1,1,,</key>
<dict>
<key>Action</key>
<string>kContextMenuPointerAction</string>
</dict>
<key>Button,2,1,,</key>
<dict>
<key>Action</key>
<string>kPasteFromClipboardPointerAction</string>
</dict>
<key>Gesture,ThreeFingerSwipeDown,,</key>
<dict>
<key>Action</key>
<string>kPrevWindowPointerAction</string>
</dict>
<key>Gesture,ThreeFingerSwipeLeft,,</key>
<dict>
<key>Action</key>
<string>kPrevTabPointerAction</string>
</dict>
<key>Gesture,ThreeFingerSwipeRight,,</key>
<dict>
<key>Action</key>
<string>kNextTabPointerAction</string>
</dict>
<key>Gesture,ThreeFingerSwipeUp,,</key>
<dict>
<key>Action</key>
<string>kNextWindowPointerAction</string>
</dict>
</dict>
<key>PreserveWindowSizeWhenTabBarVisibilityChanges</key>
<false/>
<key>Print In Black And White</key>
<true/>
<key>PromptOnQuit</key>
<false/>
<key>ShowFullScreenTabBar</key>
<false/>
<key>SoundForEsc</key>
<false/>
<key>SplitPaneDimmingAmount</key>
<real>0.40235626516990292</real>
<key>TabStyleWithAutomaticOption</key>
<integer>5</integer>
<key>TerminalMargin</key>
<integer>5</integer>
<key>TerminalVMargin</key>
<integer>2</integer>
<key>UseBorder</key>
<false/>
<key>VisualIndicatorForEsc</key>
<false/>
<key>kCPKSelectionViewPreferredModeKey</key>
<integer>1</integer>
<key>kCPKSelectionViewShowHSBTextFieldsKey</key>
<false/>
</dict>
</plist>

View file

@ -0,0 +1,30 @@
{
"title": "Change caps_lock to Esc and Control",
"rules": [
{
"description": "Post Esc if Caps is tapped, Control if held.",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_control",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "left_control",
"lazy": true
}
],
"to_if_alone": [
{
"key_code": "escape"
}
]
}
]
}
]
}

View file

@ -0,0 +1,269 @@
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"description": "Post Esc if Caps is tapped, Control if held.",
"manipulators": [
{
"from": {
"key_code": "left_control",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_control",
"lazy": true
}
],
"to_if_alone": [
{
"key_code": "escape"
}
],
"type": "basic"
}
]
}
]
},
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 641,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 641,
"vendor_id": 1452
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 666,
"vendor_id": 76
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 613,
"vendor_id": 1452
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 50504,
"vendor_id": 1133
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 50504,
"vendor_id": 1133
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
}
],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": [
{
"consumer_key_code": "display_brightness_decrement"
}
]
},
{
"from": {
"key_code": "f2"
},
"to": [
{
"consumer_key_code": "display_brightness_increment"
}
]
},
{
"from": {
"key_code": "f3"
},
"to": [
{
"apple_vendor_keyboard_key_code": "mission_control"
}
]
},
{
"from": {
"key_code": "f4"
},
"to": [
{
"apple_vendor_keyboard_key_code": "spotlight"
}
]
},
{
"from": {
"key_code": "f5"
},
"to": [
{
"consumer_key_code": "dictation"
}
]
},
{
"from": {
"key_code": "f6"
},
"to": [
{
"key_code": "f6"
}
]
},
{
"from": {
"key_code": "f7"
},
"to": [
{
"consumer_key_code": "rewind"
}
]
},
{
"from": {
"key_code": "f8"
},
"to": [
{
"consumer_key_code": "play_or_pause"
}
]
},
{
"from": {
"key_code": "f9"
},
"to": [
{
"consumer_key_code": "fast_forward"
}
]
},
{
"from": {
"key_code": "f10"
},
"to": [
{
"consumer_key_code": "mute"
}
]
},
{
"from": {
"key_code": "f11"
},
"to": [
{
"consumer_key_code": "volume_decrement"
}
]
},
{
"from": {
"key_code": "f12"
},
"to": [
{
"consumer_key_code": "volume_increment"
}
]
}
],
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [],
"virtual_hid_keyboard": {
"country_code": 0,
"indicate_sticky_modifier_keys_state": true,
"mouse_key_xy_scale": 100
}
}
]
}

289
karabiner/karabiner.json Normal file
View file

@ -0,0 +1,289 @@
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 500,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"description": "Post Esc if Caps is tapped, Control if held.",
"manipulators": [
{
"from": {
"key_code": "left_control",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "left_control",
"lazy": true
}
],
"to_if_alone": [
{
"key_code": "escape"
}
],
"type": "basic"
}
]
}
]
},
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 641,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 641,
"vendor_id": 1452
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 666,
"vendor_id": 76
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 613,
"vendor_id": 1452
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 50504,
"vendor_id": 1133
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 50504,
"vendor_id": 1133
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
}
],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": [
{
"consumer_key_code": "display_brightness_decrement"
}
]
},
{
"from": {
"key_code": "f2"
},
"to": [
{
"consumer_key_code": "display_brightness_increment"
}
]
},
{
"from": {
"key_code": "f3"
},
"to": [
{
"apple_vendor_keyboard_key_code": "mission_control"
}
]
},
{
"from": {
"key_code": "f4"
},
"to": [
{
"apple_vendor_keyboard_key_code": "spotlight"
}
]
},
{
"from": {
"key_code": "f5"
},
"to": [
{
"consumer_key_code": "dictation"
}
]
},
{
"from": {
"key_code": "f6"
},
"to": [
{
"key_code": "f6"
}
]
},
{
"from": {
"key_code": "f7"
},
"to": [
{
"consumer_key_code": "rewind"
}
]
},
{
"from": {
"key_code": "f8"
},
"to": [
{
"consumer_key_code": "play_or_pause"
}
]
},
{
"from": {
"key_code": "f9"
},
"to": [
{
"consumer_key_code": "fast_forward"
}
]
},
{
"from": {
"key_code": "f10"
},
"to": [
{
"consumer_key_code": "mute"
}
]
},
{
"from": {
"key_code": "f11"
},
"to": [
{
"consumer_key_code": "volume_decrement"
}
]
},
{
"from": {
"key_code": "f12"
},
"to": [
{
"consumer_key_code": "volume_increment"
}
]
}
],
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [
{
"from": {
"key_code": "caps_lock"
},
"to": [
{
"key_code": "left_control"
}
]
},
{
"from": {
"key_code": "escape"
},
"to": [
{
"key_code": "caps_lock"
}
]
}
],
"virtual_hid_keyboard": {
"country_code": 0,
"indicate_sticky_modifier_keys_state": true,
"mouse_key_xy_scale": 100
}
}
]
}

1
nvim/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.plugins.lua.swp

38
nvim/coc-settings.json Normal file
View file

@ -0,0 +1,38 @@
{
"coc.preferences.formatOnSaveFiletypes": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"svelte",
"json",
"graphql",
"markdown"
],
"python.formatting.provider": "black",
"python.formatting.blackPath": "/Library/Frameworks/Python.framework/Versions/3.9/bin/black",
"pyright.inlayHints.functionReturnTypes": false,
"pyright.inlayHints.variableTypes": false,
"svelte.enable-ts-plugin": true,
"eslint.probe": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"html",
"vue",
"markdown",
"svelte"
],
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"html",
"vue",
"markdown",
"svelte"
]
}

93
nvim/init.vim Normal file
View file

@ -0,0 +1,93 @@
" NEOVIM SETTINGS - settings regarding Neovim itself
" Set leader key to comma, since the default sucks for nordic keyboards
let mapleader = ','
" Set UI language to English
set langmenu=en_US
let $LANG = 'en_US'
" Disable splash screen
set shortmess+=I
" Set relative line numbers to make it easier to jump to a line
set number
set relativenumber
" Always show filename and modified marker in status line
set statusline=%f\ %m
" This setting makes search case-insensitive when all characters in the string
" being searched are lowercase. However, the search becomes case-sensitive if
" it contains any capital letters. This makes searching more convenient.
set ignorecase
set smartcase
" Disable mouse support (to force myself to use the keyboard)
set mouse=
" Use 2 spaces as default indentation
set tabstop=2
set shiftwidth=2
set expandtab
set smartindent
" Enable soft line wrapping
set wrap
set linebreak
set breakindent
" Always show 4 lines above and below the cursor
set scrolloff=4
" Allow using uppercase W and Q commands to save/quit
command WQ wq
command Wq wq
command W w
command Q q
" Type :C to open this config file
command! -nargs=0 C :e $MYVIMRC
" Type ':R' to reload config file
command! -nargs=0 R :source $MYVIMRC
" Save and close all buffers with ZZ
nnoremap ZZ :wa<CR>:qa<CR>
" Exit Terminal mode with Ctrl+k
tnoremap <C-k> <C-\><C-n>
" Make yank use system clipboard as default
nnoremap <expr> y (v:register ==# '"' ? '"+' : '') . 'y'
nnoremap <expr> yy (v:register ==# '"' ? '"+' : '') . 'yy'
nnoremap <expr> Y (v:register ==# '"' ? '"+' : '') . 'Y'
xnoremap <expr> y (v:register ==# '"' ? '"+' : '') . 'y'
xnoremap <expr> Y (v:register ==# '"' ? '"+' : '') . 'Y'
" Map 'gp' to paste from system clipboard
nnoremap <expr> gp (v:register ==# '"' ? '"+' : '') . 'p'
nnoremap <expr> gP (v:register ==# '"' ? '"+' : '') . 'P'
xnoremap <expr> gp (v:register ==# '"' ? '"+' : '') . 'p'
xnoremap <expr> gP (v:register ==# '"' ? '"+' : '') . 'P'
" Press Enter to clear search highlighting
nnoremap <silent><CR> :nohlsearch<CR>
" Disable arrow keys in normal mode - enforce hjkl instead
nnoremap <Left> :echoe "Use h"<CR>
nnoremap <Right> :echoe "Use l"<CR>
nnoremap <Up> :echoe "Use k"<CR>
nnoremap <Down> :echoe "Use j"<CR>
" Fix terminal cursor after exiting
au VimLeave * set guicursor=a:ver100
" Use Bash as shell for internal Vim commands (fish is slow)
set shell=/bin/bash
" Load default Coc config from separate file
lua require("coc-defaults")
" Load plugins from separate file
lua require("plugins")

25
nvim/lazy-lock.json Normal file
View file

@ -0,0 +1,25 @@
{
"Comment.nvim": { "branch": "master", "commit": "8d3aa5c22c2d45e788c7a5fe13ad77368b783c20" },
"auto-session": { "branch": "main", "commit": "1d3dd70a2d48e0f3441128eb4fb0b437a0bf2cc4" },
"coc.nvim": { "branch": "release", "commit": "bbaa1d5d1ff3cbd9d26bb37cfda1a990494c4043" },
"code_runner.nvim": { "branch": "main", "commit": "a010649236fe245eaab2641a13228cd601499715" },
"copilot.vim": { "branch": "release", "commit": "9e869d29e62e36b7eb6fb238a4ca6a6237e7d78b" },
"git-conflict.nvim": { "branch": "main", "commit": "80bc8931d4ed8c8c4d289a08e1838fcf4741408d" },
"gitsigns.nvim": { "branch": "main", "commit": "b1f9cf7c5c5639c006c937fc1819e09f358210fc" },
"lazy.nvim": { "branch": "main", "commit": "690f9e88e2a7dc92bcb0cca85f778a3e99fe1f7e" },
"leap.nvim": { "branch": "main", "commit": "f74473d23ebf60957e0db3ff8172349a82e5a442" },
"markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" },
"neoscroll.nvim": { "branch": "master", "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" },
"nvim-scrollbar": { "branch": "main", "commit": "f85b29805cf917f9b1d5ff0c9a52c5b1bdca5943" },
"nvim-toggleterm.lua": { "branch": "main", "commit": "2a787c426ef00cb3488c11b14f5dcf892bbd0bda" },
"nvim-tree.lua": { "branch": "master", "commit": "e14989c0eaa6f9c299d48f7e45ce1ed04b21180f" },
"nvim-web-devicons": { "branch": "master", "commit": "95b1e300699be8eb6b5be1758a9d4d69fe93cc7f" },
"onehalf": { "branch": "master", "commit": "75eb2e97acd74660779fed8380989ee7891eec56" },
"plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "580b6c48651cabb63455e97d7e131ed557b8c7e2" },
"telescope.nvim": { "branch": "master", "commit": "c1a2af0af69e80e14e6b226d3957a064cd080805" },
"vim-polyglot": { "branch": "master", "commit": "bc8a81d3592dab86334f27d1d43c080ebf680d42" },
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
"vim-visual-multi": { "branch": "master", "commit": "724bd53adfbaf32e129b001658b45d4c5c29ca1a" }
}

189
nvim/lua/coc-defaults.lua Normal file
View file

@ -0,0 +1,189 @@
-- Default config for Coc
-- From https://github.com/neoclide/coc.nvim
-- Some servers have issues with backup files, see #649
vim.opt.backup = false
vim.opt.writebackup = false
-- Having longer updatetime (default is 4000 ms = 4s) leads to noticeable
-- delays and poor user experience
vim.opt.updatetime = 300
-- Always show the signcolumn, otherwise it would shift the text each time
-- diagnostics appeared/became resolved
vim.opt.signcolumn = "yes"
local keyset = vim.keymap.set
-- Autocomplete
function _G.check_back_space()
local col = vim.fn.col('.') - 1
return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') ~= nil
end
-- Use Tab for trigger completion with characters ahead and navigate
-- NOTE: There's always a completion item selected by default, you may want to enable
-- no select by setting `"suggest.noselect": true` in your configuration file
-- NOTE: Use command ':verbose imap <tab>' to make sure Tab is not mapped by
-- other plugins before putting this into your config
local opts = {silent = true, noremap = true, expr = true, replace_keycodes = false}
keyset("i", "<TAB>", 'coc#pum#visible() ? coc#pum#next(1) : v:lua.check_back_space() ? "<TAB>" : coc#refresh()', opts)
keyset("i", "<S-TAB>", [[coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"]], opts)
-- Make <CR> to accept selected completion item or notify coc.nvim to format
-- <C-g>u breaks current undo, please make your own choice
keyset("i", "<cr>", [[coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"]], opts)
-- Use <c-j> to trigger snippets
keyset("i", "<c-j>", "<Plug>(coc-snippets-expand-jump)")
-- Use <c-space> to trigger completion
keyset("i", "<c-space>", "coc#refresh()", {silent = true, expr = true})
-- Use `[g` and `]g` to navigate diagnostics
-- Use `:CocDiagnostics` to get all diagnostics of current buffer in location list
keyset("n", "[g", "<Plug>(coc-diagnostic-prev)", {silent = true})
keyset("n", "]g", "<Plug>(coc-diagnostic-next)", {silent = true})
-- GoTo code navigation
keyset("n", "gd", "<Plug>(coc-definition)", {silent = true})
keyset("n", "gy", "<Plug>(coc-type-definition)", {silent = true})
keyset("n", "gi", "<Plug>(coc-implementation)", {silent = true})
keyset("n", "gr", "<Plug>(coc-references)", {silent = true})
-- Use K to show documentation in preview window
function _G.show_docs()
local cw = vim.fn.expand('<cword>')
if vim.fn.index({'vim', 'help'}, vim.bo.filetype) >= 0 then
vim.api.nvim_command('h ' .. cw)
elseif vim.api.nvim_eval('coc#rpc#ready()') then
vim.fn.CocActionAsync('doHover')
else
vim.api.nvim_command('!' .. vim.o.keywordprg .. ' ' .. cw)
end
end
keyset("n", "K", '<CMD>lua _G.show_docs()<CR>', {silent = true})
-- Highlight the symbol and its references on a CursorHold event(cursor is idle)
vim.api.nvim_create_augroup("CocGroup", {})
vim.api.nvim_create_autocmd("CursorHold", {
group = "CocGroup",
command = "silent call CocActionAsync('highlight')",
desc = "Highlight symbol under cursor on CursorHold"
})
-- Symbol renaming
keyset("n", "<leader>rn", "<Plug>(coc-rename)", {silent = true})
-- Formatting selected code
keyset("x", "<leader>f", "<Plug>(coc-format-selected)", {silent = true})
keyset("n", "<leader>f", "<Plug>(coc-format-selected)", {silent = true})
-- Setup formatexpr specified filetype(s)
vim.api.nvim_create_autocmd("FileType", {
group = "CocGroup",
pattern = "typescript,json",
command = "setl formatexpr=CocAction('formatSelected')",
desc = "Setup formatexpr specified filetype(s)."
})
-- Update signature help on jump placeholder
vim.api.nvim_create_autocmd("User", {
group = "CocGroup",
pattern = "CocJumpPlaceholder",
command = "call CocActionAsync('showSignatureHelp')",
desc = "Update signature help on jump placeholder"
})
-- Apply codeAction to the selected region
-- Example: `<leader>aap` for current paragraph
local opts = {silent = true, nowait = true}
keyset("x", "<leader>a", "<Plug>(coc-codeaction-selected)", opts)
keyset("n", "<leader>a", "<Plug>(coc-codeaction-selected)", opts)
-- Remap keys for apply code actions at the cursor position.
keyset("n", "<leader>ac", "<Plug>(coc-codeaction-cursor)", opts)
-- Remap keys for apply code actions affect whole buffer.
keyset("n", "<leader>as", "<Plug>(coc-codeaction-source)", opts)
-- Remap keys for applying codeActions to the current buffer
keyset("n", "<leader>ac", "<Plug>(coc-codeaction)", opts)
-- Apply the most preferred quickfix action on the current line.
keyset("n", "<leader>qf", "<Plug>(coc-fix-current)", opts)
-- Remap keys for apply refactor code actions.
keyset("n", "<leader>re", "<Plug>(coc-codeaction-refactor)", { silent = true })
keyset("x", "<leader>r", "<Plug>(coc-codeaction-refactor-selected)", { silent = true })
keyset("n", "<leader>r", "<Plug>(coc-codeaction-refactor-selected)", { silent = true })
-- Run the Code Lens actions on the current line
keyset("n", "<leader>cl", "<Plug>(coc-codelens-action)", opts)
-- Map function and class text objects
-- NOTE: Requires 'textDocument.documentSymbol' support from the language server
keyset("x", "if", "<Plug>(coc-funcobj-i)", opts)
keyset("o", "if", "<Plug>(coc-funcobj-i)", opts)
keyset("x", "af", "<Plug>(coc-funcobj-a)", opts)
keyset("o", "af", "<Plug>(coc-funcobj-a)", opts)
keyset("x", "ic", "<Plug>(coc-classobj-i)", opts)
keyset("o", "ic", "<Plug>(coc-classobj-i)", opts)
keyset("x", "ac", "<Plug>(coc-classobj-a)", opts)
keyset("o", "ac", "<Plug>(coc-classobj-a)", opts)
-- Remap <C-f> and <C-b> to scroll float windows/popups
---@diagnostic disable-next-line: redefined-local
local opts = {silent = true, nowait = true, expr = true}
keyset("n", "<C-f>", 'coc#float#has_scroll() ? coc#float#scroll(1) : "<C-f>"', opts)
keyset("n", "<C-b>", 'coc#float#has_scroll() ? coc#float#scroll(0) : "<C-b>"', opts)
keyset("i", "<C-f>",
'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(1)<cr>" : "<Right>"', opts)
keyset("i", "<C-b>",
'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(0)<cr>" : "<Left>"', opts)
keyset("v", "<C-f>", 'coc#float#has_scroll() ? coc#float#scroll(1) : "<C-f>"', opts)
keyset("v", "<C-b>", 'coc#float#has_scroll() ? coc#float#scroll(0) : "<C-b>"', opts)
-- Use CTRL-S for selections ranges
-- Requires 'textDocument/selectionRange' support of language server
keyset("n", "<C-s>", "<Plug>(coc-range-select)", {silent = true})
keyset("x", "<C-s>", "<Plug>(coc-range-select)", {silent = true})
-- Add `:Format` command to format current buffer
vim.api.nvim_create_user_command("Format", "call CocAction('format')", {})
-- " Add `:Fold` command to fold current buffer
vim.api.nvim_create_user_command("Fold", "call CocAction('fold', <f-args>)", {nargs = '?'})
-- Add `:OR` command for organize imports of the current buffer
vim.api.nvim_create_user_command("OR", "call CocActionAsync('runCommand', 'editor.action.organizeImport')", {})
-- Add (Neo)Vim's native statusline support
-- NOTE: Please see `:h coc-status` for integrations with external plugins that
-- provide custom statusline: lightline.vim, vim-airline
vim.opt.statusline:append(" (%{coc#status()}%{get(b:,'coc_current_function','')})")
-- Mappings for CoCList
-- code actions and coc stuff
---@diagnostic disable-next-line: redefined-local
local opts = {silent = true, nowait = true}
-- Show all diagnostics
keyset("n", "<space>a", ":<C-u>CocList diagnostics<cr>", opts)
-- Manage extensions
keyset("n", "<space>e", ":<C-u>CocList extensions<cr>", opts)
-- Show commands
keyset("n", "<space>c", ":<C-u>CocList commands<cr>", opts)
-- Find symbol of current document
keyset("n", "<space>o", ":<C-u>CocList outline<cr>", opts)
-- Search workspace symbols
keyset("n", "<space>s", ":<C-u>CocList -I symbols<cr>", opts)
-- Do default action for next item
keyset("n", "<space>j", ":<C-u>CocNext<cr>", opts)
-- Do default action for previous item
keyset("n", "<space>k", ":<C-u>CocPrev<cr>", opts)
-- Resume latest coc list
keyset("n", "<space>p", ":<C-u>CocListResume<cr>", opts)

246
nvim/lua/plugins.lua Normal file
View file

@ -0,0 +1,246 @@
-- Install lazy.nvim (plugin manager)
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
-- Install plugins
require("lazy").setup({
-- Color scheme
{
"sonph/onehalf",
priority = 1000,
config = function(plugin)
vim.opt.rtp:append(plugin.dir .. "/vim")
vim.opt.termguicolors = true
vim.cmd([[colorscheme onehalfdark]])
end
},
-- VSCode-like language server
{
"neoclide/coc.nvim",
branch = "release",
init = function()
vim.g.coc_global_extensions = {
"coc-pyright",
"coc-clangd",
"coc-tsserver",
"@yaegassy/coc-volar",
"coc-svelte",
"coc-emmet",
"coc-prettier",
"coc-eslint",
}
end
},
-- Syntax highlighting for almost every language
{
"sheerun/vim-polyglot",
init = function()
vim.g.vim_svelte_plugin_load_full_syntax = 1
vim.g.vim_svelte_plugin_use_typescript = 1
vim.g.vim_svelte_plugin_use_sass = 1
end
},
-- Add two-character motions with s and S
{
"ggandor/leap.nvim",
keys = "s",
dependencies = {
"tpope/vim-repeat",
},
config = function()
require('leap').add_default_mappings()
end
},
-- VSCode-like multi-cursor support
{
"mg979/vim-visual-multi",
branch = "master",
},
-- Easy commenting/uncommenting
{
"numToStr/Comment.nvim",
config = true,
},
-- Easy handling of surroundings
{
"tpope/vim-surround",
dependencies = {
"tpope/vim-repeat",
},
},
-- GitHub Copilot
{
"github/copilot.vim",
cmd = "CPE", -- Don't load until enable command is run
config = function()
vim.api.nvim_create_user_command("CPE", "Copilot enable", {})
vim.api.nvim_create_user_command("CPD", "Copilot disable", {})
end
},
-- Auto-restore session when opening Neovim
{
"rmagatti/auto-session",
opts = {
log_level = "error",
},
},
-- File explorer sidebar
{
"kyazdani42/nvim-tree.lua",
commit = "e14989c", -- newer versions break auto-session
dependencies = {
"kyazdani42/nvim-web-devicons",
},
opts = {
update_focused_file = {
enable = true,
},
view = {
signcolumn = "auto",
adaptive_size = true,
mappings = {
list = {
{ key = "+", action = "cd" },
},
},
},
},
init = function()
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.keymap.set("n", "<leader>n", ":NvimTreeToggle<CR>", { noremap = true, silent = true })
end,
},
-- Fuzzy finder for files, buffers, etc.
{
"nvim-telescope/telescope.nvim",
tag = "0.1.1",
dependencies = {
"nvim-lua/plenary.nvim",
{"nvim-telescope/telescope-fzf-native.nvim", build = "make"},
},
keys = {
{"<leader>p", "<cmd>Telescope find_files<CR>", noremap = true, silent = true},
{"<leader>f", "<cmd>Telescope live_grep<CR>", noremap = true, silent = true},
{"<leader>b", "<cmd>Telescope buffers<CR>", noremap = true, silent = true},
{"<leader>o", "<cmd>Telescope oldfiles<CR>", noremap = true, silent = true},
{"<leader>t", "<cmd>Telescope tags<CR>", noremap = true, silent = true},
{"<leader>:", "<cmd>Telescope commands<CR>", noremap = true, silent = true},
{"<leader>d", "<cmd>Telescope git_status<CR>", noremap = true, silent = true},
{"<leader><leader>", "<cmd>Telescope resume<CR>", noremap = true, silent = true},
},
config = function()
require("telescope").setup{}
require("telescope").load_extension("fzf")
end,
},
-- Persistent terminal that can be toggled with a keybinding
{
"akinsho/nvim-toggleterm.lua",
tag = "2.3.0",
keys = "<C-j>",
opts = {
size = 20,
hide_numbers = true,
direction = 'horizontal',
open_mapping = [[<C-j>]],
shade_terminals = true,
shading_factor = 2,
shell = 'fish'
}
},
-- Run code with a keybinding
{
"CRAG666/code_runner.nvim",
cmd = "RunCode",
dependencies = {
"akinsho/nvim-toggleterm.lua"
},
opts = {
mode = "toggleterm",
filetype = {
python = "python",
javascript = "node",
typescript = "node",
c = "gcc -o main % && ./main",
},
},
init = function()
vim.keymap.set("n", "<leader><CR>", ":RunCode<CR>", { noremap = true })
end,
},
-- Live Markdown preview in browser
{
"iamcco/markdown-preview.nvim",
build = "cd app && npm install",
ft = "markdown",
init = function()
vim.g.mkdp_auto_close = 0
end,
},
-- Git integration - show modified lines next to line numbers
{
"lewis6991/gitsigns.nvim",
config = function()
require("gitsigns").setup()
require("scrollbar.handlers.gitsigns").setup()
end,
},
-- Tool for resolving Git merge conflicts
{
"akinsho/git-conflict.nvim",
tag = "v1.0.0",
config = true,
},
-- VSCode-like scrollbar with Git and diagnostic markers
{
"petertriho/nvim-scrollbar",
opts = {
marks = {
Search = { color = "#ff9e64" },
Error = { color = "#db4b4b" },
Warn = { color = "#e0af68" },
Info = { color = "#0db9d7" },
Hint = { color = "#1abc9c" },
Misc = { color = "#9d7cd8" },
GitAdd = { color = "#9ece6a" },
GitChange = { color = "#e0af68" },
GitDelete = { color = "#914c54" },
}
}
},
-- Smooth scrolling
{
"karb94/neoscroll.nvim",
opts = {
easing_function = "sine",
}
},
})

1
nvim/lua/test.py Normal file
View file

@ -0,0 +1 @@
print("Hwell")

64
vim/.vimrc Normal file
View file

@ -0,0 +1,64 @@
" Some nice defaults borrowed from Neovim
set nocompatible
set autoindent
set autoread
set belloff=all
set backspace=indent,eol,start
set encoding=utf-8
set laststatus=2
set history=10000
set hlsearch
set incsearch
set smarttab
set ttimeout
set ttimeoutlen=50
set ttyfast
set wildmenu
syntax on
let &t_SI = "\e[6 q"
let &t_EI = "\e[2 q"
" Set relative line numbers to make it easier to jump to a line
set number
set relativenumber
" Always show filename and modified marker in status line
set statusline=%f\ %m
" This setting makes search case-insensitive when all characters in the string
" being searched are lowercase. However, the search becomes case-sensitive if
" it contains any capital letters. This makes searching more convenient.
set ignorecase
set smartcase
" Enable mouse support
set mouse+=a
" Use 2 spaces as default indentation
set tabstop=2
set shiftwidth=2
set expandtab
set smartindent
" Enable soft line wrapping
set wrap
set linebreak
set breakindent
" Always show 4 lines above and below the cursor
set scrolloff=4
" Allow using uppercase W and Q commands to save/quit
command WQ wq
command Wq wq
command W w
command Q q
" Type :C to open this config file
command! -nargs=0 C :e $MYVIMRC
" Type ':R' to reload config file
command! -nargs=0 R :source $MYVIMRC
" Press Enter to clear search highlighting
nnoremap <silent><CR> :nohlsearch<CR>

85
vscode-neovim/init.vim Normal file
View file

@ -0,0 +1,85 @@
" NEOVIM SETTINGS - settings regarding Neovim itself
" Set leader key to comma, since the default sucks for nordic keyboards
let mapleader = ','
" This setting makes search case-insensitive when all characters in the string
" being searched are lowercase. However, the search becomes case-sensitive if
" it contains any capital letters. This makes searching more convenient.
set ignorecase
set smartcase
" Enable searching as you type, rather than waiting till you press enter.
set incsearch
" Always show 4 lines above and below the cursor
set scrolloff=4
" Allow using uppercase :W to save
command W call VSCodeCall('workbench.action.files.save')
" Make yank use system clipboard as default
:nnoremap <expr> y (v:register ==# '"' ? '"+' : '') . 'y'
:nnoremap <expr> yy (v:register ==# '"' ? '"+' : '') . 'yy'
:nnoremap <expr> Y (v:register ==# '"' ? '"+' : '') . 'Y'
:xnoremap <expr> y (v:register ==# '"' ? '"+' : '') . 'y'
:xnoremap <expr> Y (v:register ==# '"' ? '"+' : '') . 'Y'
" Map 'gp' to paste from system clipboard
:nnoremap <expr> gp (v:register ==# '"' ? '"+' : '') . 'p'
:nnoremap <expr> gP (v:register ==# '"' ? '"+' : '') . 'P'
:xnoremap <expr> gp (v:register ==# '"' ? '"+' : '') . 'p'
:xnoremap <expr> gP (v:register ==# '"' ? '"+' : '') . 'P'
" Map leader bindings to VSCode commands
nnoremap <leader>p <cmd>call VSCodeNotify('workbench.action.quickOpen')<cr>
nnoremap <leader>b <cmd>call VSCodeNotify('workbench.action.showAllEditors')<cr>
nnoremap <leader>o <cmd>call VSCodeNotify('workbench.action.quickOpen')<cr>
nnoremap <leader>f <cmd>call VSCodeNotify('workbench.action.findInFiles')<cr>
nnoremap <leader>: <cmd>call VSCodeNotify('workbench.action.showCommands')<cr>
nnoremap <leader>d <cmd>call VSCodeNotify('workbench.view.scm')<cr>
nnoremap <leader>n <cmd>call VSCodeNotify('workbench.action.toggleSidebarVisibility')<cr>
" Disable arrow keys in normal mode - enforce hjkl instead
nnoremap <Left> :echoe "Use h"<CR>
nnoremap <Right> :echoe "Use l"<CR>
nnoremap <Up> :echoe "Use k"<CR>
nnoremap <Down> :echoe "Use j"<CR>
" PLUGINS - installation and configuration
" Install Plug (plugin manager) if not already installed
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 * q
endif
" Install plugins automatically when launching Neovim
autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
\| PlugInstall --sync | source $MYVIMRC
\| endif
" Fetch plugins with Plug
call plug#begin()
" Add two-character motions with s and S
Plug 'ggandor/leap.nvim'
Plug 'tpope/vim-repeat'
" Easy commenting/uncommenting
Plug 'numToStr/Comment.nvim'
" Easy handling of surroundings (tags, brackets etc.)
Plug 'tpope/vim-surround'
" End of plugin fetching
call plug#end()
" Configure leap
lua require('leap').add_default_mappings()
" Configure Comment.nvim
lua require('Comment').setup()