feat: Adding large changes to the neovim config, adding documentation to everything, and minor tweaks to zsh, tmux and wezterm
This commit is contained in:
parent
742b4d43a2
commit
1ad3cef941
78
README.md
78
README.md
@ -1,2 +1,76 @@
|
|||||||
# dotfiles
|
# FaultyBranches Dotfiles
|
||||||
Small set of non-machine specific dotfiles
|
|
||||||
|
Yet another repository of dotfiles, this time for the FaultyBranches way of setting up a non-machine specific user's software.
|
||||||
|
|
||||||
|
Included are configs for:
|
||||||
|
- neovim
|
||||||
|
- tmux
|
||||||
|
- wezterm
|
||||||
|
- zsh
|
||||||
|
|
||||||
|
While the setup is opinionated its goal is to provide desired behaviour rather than limiting to specific
|
||||||
|
|
||||||
|
## Applications
|
||||||
|
### Neovim
|
||||||
|
|
||||||
|
Console/terminal based text editor with hefty extensibility, speed and flexibility.
|
||||||
|
|
||||||
|
The configs are an attempt at including some IDE functionalities
|
||||||
|
- Auto-complete via nvim-cmp
|
||||||
|
- LSP setup via lspconfig and mason
|
||||||
|
- Debugging via DAP and plugins
|
||||||
|
- Code snippets via luasnips and a base
|
||||||
|
- Git integration via gitsigns
|
||||||
|
- Syntax highlighting and symbol parsing via treesitter
|
||||||
|
- Quality of life options
|
||||||
|
- Language aware shortcuts for (un)commenting lines or blocks
|
||||||
|
- Zettlekasten style note plugin for taking/searching/linking notes
|
||||||
|
- Markdown preview that opens a live updating html view of an edited markdown file
|
||||||
|
- Telescope fuzzy search for files and file contents
|
||||||
|
|
||||||
|
### Tmux
|
||||||
|
|
||||||
|
_The_ terminal multiplexer for windowing and pane setups for long running shell sessions.
|
||||||
|
|
||||||
|
Simple configuration setup for a few shortcuts, adding the tpm plugin manager, and adding a couple plugins for colorscheme, system clipboard interactions
|
||||||
|
and a few "sensible" settings.
|
||||||
|
|
||||||
|
The main changes to shortcuts involve:
|
||||||
|
- Moving to Ctrl-Space for the prefix leader instead of the default Ctrl-b
|
||||||
|
- Using `\` and `-` for splitting the window vertically and horizontally, respectively, and unbinding the defaults
|
||||||
|
- Adding a config reload shortcut of `<prefix> r`
|
||||||
|
- Moving to vim-like movement between panes and windows
|
||||||
|
- Removing auto-renaming of windows based on content
|
||||||
|
|
||||||
|
### Wezterm
|
||||||
|
|
||||||
|
Cross-platform terminal emulator built from the ground up with speed, good font rendering, true color and a host of nice optional functions.
|
||||||
|
|
||||||
|
Simple setup with automatic config reloading, a colorscheme, font and a couple other bits.
|
||||||
|
|
||||||
|
### Zsh
|
||||||
|
|
||||||
|
NOTE: Auto-installs oh-my-zsh directly from the github repository when a user opens Zsh for the first time
|
||||||
|
|
||||||
|
Sets up the oh-my-zsh framework with:
|
||||||
|
- Colorscheme
|
||||||
|
- Autosuggestions and virtual text
|
||||||
|
- Prompt theme
|
||||||
|
- Python virtualenv auto-loader
|
||||||
|
- .env auto-loader
|
||||||
|
- AWS helper
|
||||||
|
- Git helper and prompt updater
|
||||||
|
|
||||||
|
The config adds the following settings outside of oh-my-zsh:
|
||||||
|
- PATH environment variable additions for:
|
||||||
|
- Go binaries
|
||||||
|
- Rust binaries
|
||||||
|
- User $HOME based `.local/bin`
|
||||||
|
- NVM (Nodejs) binaries
|
||||||
|
- Keychain initialization for caching SSH keys
|
||||||
|
- Adding a timing function for checking ZSH load timing
|
||||||
|
- NVM (Nodejs) environment variable setup and completion loading
|
||||||
|
- Local specific configuration file loading, with three initial configs:
|
||||||
|
- `.zsh_aliases`: Aliases for local specific commands
|
||||||
|
- `.zsh_exports`: Exported variables for a specific system
|
||||||
|
- `.zsh_local`: Local ZSH settings for a specific system such as any environment specific bash required to set up a system's shell or direct ZSH settings
|
||||||
|
|||||||
@ -42,10 +42,18 @@ return {
|
|||||||
close = { 'q', '<Esc>' },
|
close = { 'q', '<Esc>' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
windows = { indent = 1 },
|
windows = {
|
||||||
|
indent = 1
|
||||||
|
},
|
||||||
render = {
|
render = {
|
||||||
max_type_length = nil,
|
max_type_length = nil,
|
||||||
},
|
},
|
||||||
|
ensure_installed = {
|
||||||
|
'codelldb',
|
||||||
|
'cpptools',
|
||||||
|
'debugpy',
|
||||||
|
|
||||||
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
@ -69,28 +77,42 @@ return {
|
|||||||
dapui.close()
|
dapui.close()
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.fn.sign_define('DapBreakpoint', { text = 'ᛒ', texthl = '', lineh = '', numhl = '' })
|
-- vim.fn.sign_define('DapBreakpoint', { text = 'ᛒ', texthl = '', lineh = '', numhl = '' })
|
||||||
|
vim.fn.sign_define('DapBreakpoint', { text = '🟥', texthl = '', lineh = '', numhl = '' })
|
||||||
vim.fn.sign_define('DapBreakpointCondition', { text = '🝌', texthl = '', lineh = '', numhl = '' })
|
vim.fn.sign_define('DapBreakpointCondition', { text = '🝌', texthl = '', lineh = '', numhl = '' })
|
||||||
vim.fn.sign_define('DapStopped', { text = '⮞' })
|
vim.fn.sign_define('DapStopped', { text = '▶️' })
|
||||||
|
|
||||||
dap.adapters.gdb = {
|
dap.adapters.gdb = {
|
||||||
type = 'executable',
|
type = 'executable',
|
||||||
command = 'gdb',
|
command = 'gdb',
|
||||||
args = { '-i', 'dap' }
|
args = { '-i', 'dap' },
|
||||||
}
|
}
|
||||||
|
|
||||||
dap.configurations.rust = {
|
dap.adapters.lldb = {
|
||||||
{
|
type = 'executable',
|
||||||
name = 'Launch',
|
command = 'lldb',
|
||||||
type = 'gdb',
|
|
||||||
request = 'launch',
|
|
||||||
program = function()
|
|
||||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
|
||||||
end,
|
|
||||||
cwd = '${workspaceFolder}',
|
|
||||||
stopAtBeginningOfMainSubprogram = false,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dap.adapters.debugpy = {
|
||||||
|
type = 'executable',
|
||||||
|
command = 'debugpy',
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.configurations = {
|
||||||
|
-- rust = {
|
||||||
|
-- {
|
||||||
|
-- type = 'gdb',
|
||||||
|
-- name = 'Debug',
|
||||||
|
-- request = 'launch',
|
||||||
|
-- program = function()
|
||||||
|
-- return vim.fn.getcwd() .. '/target/debug/faultybranches'
|
||||||
|
-- end,
|
||||||
|
-- stopAtBeginningOfMainSubprogram = true,
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
}
|
||||||
|
|
||||||
|
require('dap.ext.vscode').load_launchjs('.launch.json', {})
|
||||||
end,
|
end,
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
return {
|
return {
|
||||||
'williamboman/mason.nvim',
|
'mason-org/mason.nvim',
|
||||||
config = function()
|
config = function()
|
||||||
require('mason').setup()
|
require('mason').setup()
|
||||||
|
|
||||||
local mason_lspconfig = require('mason-lspconfig')
|
|
||||||
|
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
|
|
||||||
@ -24,21 +22,12 @@ return {
|
|||||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||||
vim.keymap.set('n', 'gs', vim.lsp.buf.signature_help, bufopts)
|
vim.keymap.set('n', 'gs', vim.lsp.buf.signature_help, bufopts)
|
||||||
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
|
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
|
||||||
-- vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, bufopts)
|
|
||||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||||
vim.keymap.set('n', '<leader><leader>f', function() vim.lsp.buf.format { async = true } end, bufopts)
|
vim.keymap.set('n', '<leader><leader>f', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||||
|
|
||||||
-- DAP debug
|
|
||||||
if dap then
|
|
||||||
vim.keymap.set('n', '<F5>', function() dap.continue() end, bufopts)
|
|
||||||
vim.keymap.set('n', '<F10>', function() dap.step_over() end, bufopts)
|
|
||||||
vim.keymap.set('n', '<F11>', function() dap.step_into() end, bufopts)
|
|
||||||
vim.keymap.set('n', '<F12>', function() dap.step_out() end, bufopts)
|
|
||||||
vim.keymap.set('n', '<leader>b', function() dap.toggle_breakpoint() end, bufopts)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
mason_lspconfig.setup {
|
require('mason-lspconfig').setup {
|
||||||
|
automatic_enable = true,
|
||||||
automatic_installation = true,
|
automatic_installation = true,
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
'ansiblels',
|
'ansiblels',
|
||||||
@ -47,39 +36,74 @@ return {
|
|||||||
'clangd', -- C/C++
|
'clangd', -- C/C++
|
||||||
-- 'hadolint', -- Dockerfile linting
|
-- 'hadolint', -- Dockerfile linting
|
||||||
'intelephense', -- PHP
|
'intelephense', -- PHP
|
||||||
'jdtls', -- java
|
-- 'jdtls', -- java
|
||||||
'lua_ls',
|
'lua_ls',
|
||||||
'marksman', -- markdown
|
'marksman', -- markdown
|
||||||
-- 'prettier',
|
|
||||||
'pylsp',
|
'pylsp',
|
||||||
'rust_analyzer',
|
'rust_analyzer',
|
||||||
-- 'snyk_ls',
|
|
||||||
'ts_ls', -- Typscript
|
'ts_ls', -- Typscript
|
||||||
'yamlls',
|
'yamlls',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local lspconfig = require('lspconfig')
|
vim.diagnostic.config ({
|
||||||
|
virtual_text = {
|
||||||
|
source = "always",
|
||||||
|
},
|
||||||
|
severity_sort = true,
|
||||||
|
float = {
|
||||||
|
source = "always"
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
mason_lspconfig.setup_handlers {
|
-- Kick the logging to debug level
|
||||||
function(server_name)
|
-- vim.lsp.set_log_level("debug")
|
||||||
lspconfig[server_name].setup {
|
|
||||||
capabilities = capabilities,
|
vim.lsp.config('gdscript', {
|
||||||
on_attach = on_attach
|
flags = {
|
||||||
|
debounce_text_changes = 100,
|
||||||
}
|
}
|
||||||
end,
|
})
|
||||||
|
|
||||||
['rust_analyzer'] = function()
|
vim.lsp.config('lua_ls', {
|
||||||
lspconfig.rust_analyzer.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
settings = {
|
settings = {
|
||||||
['rust-analyzer'] = {
|
Lua = {
|
||||||
checkOnSave = true,
|
diagnostics = {
|
||||||
-- check = {
|
globals = {
|
||||||
-- command = 'clippy',
|
'vim'
|
||||||
-- extraArgs = { '--', '-Dclippy::all', '-Wclippy::pedantic' },
|
}
|
||||||
-- },
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.config('pylsp', {
|
||||||
|
settings = {
|
||||||
|
pylsp = {
|
||||||
|
plugins = {
|
||||||
|
pycodestyle = {
|
||||||
|
ignore = {
|
||||||
|
'E501' -- Ignore line length pep8 warnings
|
||||||
|
},
|
||||||
|
maxLineLength = 120,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.config("rust_analyzer", {
|
||||||
|
settings = {
|
||||||
|
['rust_analyzer'] = {
|
||||||
|
check = {
|
||||||
|
command = 'clippy',
|
||||||
|
extraArgs = {
|
||||||
|
'--',
|
||||||
|
'-D clippy::all',
|
||||||
|
'-W clippy::pedantic',
|
||||||
|
'-W clippy::restriction'
|
||||||
|
},
|
||||||
|
},
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
enable = true,
|
enable = true,
|
||||||
experimental = {
|
experimental = {
|
||||||
@ -88,51 +112,16 @@ return {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
end,
|
|
||||||
|
|
||||||
['lua_ls'] = function()
|
vim.lsp.config("*", {
|
||||||
lspconfig.lua_ls.setup {
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
settings = {
|
})
|
||||||
Lua = {
|
|
||||||
diagnostics = {
|
|
||||||
globals = { 'vim' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
|
|
||||||
['pylsp'] = function()
|
|
||||||
lspconfig.pylsp.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
settings = {
|
|
||||||
pylsp = {
|
|
||||||
plugins = {
|
|
||||||
pycodestyle = {
|
|
||||||
ignore = {'E501'},
|
|
||||||
maxLineLength = 120
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
|
|
||||||
lspconfig.gdscript.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
flags = {
|
|
||||||
debounce_text_changes = 100,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
end,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'williamboman/mason-lspconfig.nvim',
|
'mason-org/mason-lspconfig.nvim',
|
||||||
'jay-babu/mason-nvim-dap.nvim',
|
'jay-babu/mason-nvim-dap.nvim',
|
||||||
},
|
},
|
||||||
|
lazy = false,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ setw -gq utf8 on
|
|||||||
# Allow mouse interactions
|
# Allow mouse interactions
|
||||||
set -g mouse on
|
set -g mouse on
|
||||||
|
|
||||||
|
# Disable auto-renaming of windows
|
||||||
set-option -g allow-rename
|
set-option -g allow-rename
|
||||||
|
|
||||||
# Bindings
|
# Bindings
|
||||||
@ -18,8 +19,12 @@ bind-key C-Space send-prefix
|
|||||||
## More natural window splits
|
## More natural window splits
|
||||||
bind \\ split-window -h -c "#{pane_current_path}"
|
bind \\ split-window -h -c "#{pane_current_path}"
|
||||||
bind - split-window -v -c "#{pane_current_path}"
|
bind - split-window -v -c "#{pane_current_path}"
|
||||||
|
|
||||||
|
## Remove original split shortcuts
|
||||||
unbind '"'
|
unbind '"'
|
||||||
unbind %
|
unbind %
|
||||||
|
|
||||||
|
## Reload the config while inside of tmux
|
||||||
bind r source-file ~/.tmux.conf; display-message "Config reloaded..."
|
bind r source-file ~/.tmux.conf; display-message "Config reloaded..."
|
||||||
|
|
||||||
## Better pane navigation
|
## Better pane navigation
|
||||||
@ -32,9 +37,6 @@ bind -n C-M-l select-pane -R
|
|||||||
bind -n M-h previous-window
|
bind -n M-h previous-window
|
||||||
bind -n M-l next-window
|
bind -n M-l next-window
|
||||||
|
|
||||||
## Reload the config while inside of tmux
|
|
||||||
bind r source-file ~/.tmux.conf
|
|
||||||
|
|
||||||
# Plugins
|
# Plugins
|
||||||
set -g @plugin 'tmux-plugins/tpm'
|
set -g @plugin 'tmux-plugins/tpm'
|
||||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||||
@ -44,4 +46,5 @@ set -g @plugin 'egel/tmux-gruvbox'
|
|||||||
# Plugin settings
|
# Plugin settings
|
||||||
# set -g @tmux-gruvbox 'dark-transparent'
|
# set -g @tmux-gruvbox 'dark-transparent'
|
||||||
|
|
||||||
|
## Required for TPM plugins
|
||||||
run '~/.tmux/plugins/tpm/tpm'
|
run '~/.tmux/plugins/tpm/tpm'
|
||||||
|
|||||||
14
wezterm.lua
14
wezterm.lua
@ -1,5 +1,8 @@
|
|||||||
local wezterm = require 'wezterm'
|
local wezterm = require 'wezterm'
|
||||||
|
|
||||||
|
local config = wezterm.config_builder()
|
||||||
|
|
||||||
|
-- Fixing the cursor theme
|
||||||
local xcursor_size = nil
|
local xcursor_size = nil
|
||||||
local xcursor_theme = nil
|
local xcursor_theme = nil
|
||||||
|
|
||||||
@ -25,8 +28,11 @@ if success then
|
|||||||
xcursor_size = tonumber(stdout)
|
xcursor_size = tonumber(stdout)
|
||||||
end
|
end
|
||||||
|
|
||||||
local config = wezterm.config_builder()
|
config.xcursor_theme = xcursor_theme
|
||||||
|
config.xcursor_size = xcursor_size
|
||||||
|
-- end cursor theme
|
||||||
|
|
||||||
|
-- Visual options
|
||||||
config.color_scheme = 's3r0 modified (terminal.sexy)'
|
config.color_scheme = 's3r0 modified (terminal.sexy)'
|
||||||
-- config.color_scheme = 'darkmatrix'
|
-- config.color_scheme = 'darkmatrix'
|
||||||
-- config.color_scheme = 'Mashup Colors (terminal.sexy)'
|
-- config.color_scheme = 'Mashup Colors (terminal.sexy)'
|
||||||
@ -43,11 +49,9 @@ config.window_padding = {
|
|||||||
top = '0',
|
top = '0',
|
||||||
bottom = '0'
|
bottom = '0'
|
||||||
}
|
}
|
||||||
|
-- config.window_background_opacity = 0.9
|
||||||
|
-- end visual options
|
||||||
|
|
||||||
config.automatically_reload_config = true
|
config.automatically_reload_config = true
|
||||||
|
|
||||||
-- config.window_background_opacity = 0.9
|
|
||||||
config.xcursor_theme = xcursor_theme
|
|
||||||
config.xcursor_size = xcursor_size
|
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|||||||
2
zshrc
2
zshrc
@ -59,12 +59,14 @@ zstyle ':completion:*:warnings' format '%BNo matches for: %d%b'
|
|||||||
|
|
||||||
### User configuration
|
### User configuration
|
||||||
export EDITOR=nvim
|
export EDITOR=nvim
|
||||||
|
export NVM_CONFIG_PREFIX=$HOME/.local/
|
||||||
|
|
||||||
# Paths to prepend to system path
|
# Paths to prepend to system path
|
||||||
path=(
|
path=(
|
||||||
$GOPATH/bin
|
$GOPATH/bin
|
||||||
$HOME/.cargo/bin
|
$HOME/.cargo/bin
|
||||||
$HOME/.local/bin
|
$HOME/.local/bin
|
||||||
|
$NVM_CONFIG_PREFIX/bin
|
||||||
$path
|
$path
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user