diff --git a/README.md b/README.md index b0a7bff..329682f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,76 @@ -# dotfiles -Small set of non-machine specific dotfiles +# FaultyBranches 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 ` 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 diff --git a/nvim/lua/plugins/dap.lua b/nvim/lua/plugins/dap.lua index fad9603..250bea7 100644 --- a/nvim/lua/plugins/dap.lua +++ b/nvim/lua/plugins/dap.lua @@ -42,10 +42,18 @@ return { close = { 'q', '' }, }, }, - windows = { indent = 1 }, + windows = { + indent = 1 + }, render = { max_type_length = nil, }, + ensure_installed = { + 'codelldb', + 'cpptools', + 'debugpy', + + }, }) end, }, @@ -69,28 +77,42 @@ return { dapui.close() 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('DapStopped', { text = '⮞' }) + vim.fn.sign_define('DapStopped', { text = '▶️' }) dap.adapters.gdb = { type = 'executable', command = 'gdb', - args = { '-i', 'dap' } + args = { '-i', 'dap' }, } - dap.configurations.rust = { - { - name = 'Launch', - type = 'gdb', - request = 'launch', - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') - end, - cwd = '${workspaceFolder}', - stopAtBeginningOfMainSubprogram = false, - }, + dap.adapters.lldb = { + type = 'executable', + command = 'lldb', } + + 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, keys = { { diff --git a/nvim/lua/plugins/mason.lua b/nvim/lua/plugins/mason.lua index 5485f82..ec1ca1a 100644 --- a/nvim/lua/plugins/mason.lua +++ b/nvim/lua/plugins/mason.lua @@ -1,10 +1,8 @@ return { - 'williamboman/mason.nvim', + 'mason-org/mason.nvim', config = function() require('mason').setup() - local mason_lspconfig = require('mason-lspconfig') - local capabilities = vim.lsp.protocol.make_client_capabilities() 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', 'gs', vim.lsp.buf.signature_help, bufopts) vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) - -- vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) vim.keymap.set('n', 'f', function() vim.lsp.buf.format { async = true } end, bufopts) - - -- DAP debug - if dap then - vim.keymap.set('n', '', function() dap.continue() end, bufopts) - vim.keymap.set('n', '', function() dap.step_over() end, bufopts) - vim.keymap.set('n', '', function() dap.step_into() end, bufopts) - vim.keymap.set('n', '', function() dap.step_out() end, bufopts) - vim.keymap.set('n', 'b', function() dap.toggle_breakpoint() end, bufopts) - end end - mason_lspconfig.setup { + require('mason-lspconfig').setup { + automatic_enable = true, automatic_installation = true, ensure_installed = { 'ansiblels', @@ -47,92 +36,92 @@ return { 'clangd', -- C/C++ -- 'hadolint', -- Dockerfile linting 'intelephense', -- PHP - 'jdtls', -- java + -- 'jdtls', -- java 'lua_ls', 'marksman', -- markdown - -- 'prettier', 'pylsp', 'rust_analyzer', - -- 'snyk_ls', 'ts_ls', -- Typscript 'yamlls', } } - local lspconfig = require('lspconfig') - - mason_lspconfig.setup_handlers { - function(server_name) - lspconfig[server_name].setup { - capabilities = capabilities, - on_attach = on_attach - } - end, - - ['rust_analyzer'] = function() - lspconfig.rust_analyzer.setup { - capabilities = capabilities, - on_attach = on_attach, - settings = { - ['rust-analyzer'] = { - checkOnSave = true, - -- check = { - -- command = 'clippy', - -- extraArgs = { '--', '-Dclippy::all', '-Wclippy::pedantic' }, - -- }, - diagnostics = { - enable = true, - experimental = { - enable = true, - } - } - } - } - } - end, - - ['lua_ls'] = function() - lspconfig.lua_ls.setup { - capabilities = capabilities, - 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, - } + vim.diagnostic.config ({ + virtual_text = { + source = "always", }, - } + severity_sort = true, + float = { + source = "always" + }, + }) + + -- Kick the logging to debug level + -- vim.lsp.set_log_level("debug") + + vim.lsp.config('gdscript', { + flags = { + debounce_text_changes = 100, + } + }) + + vim.lsp.config('lua_ls', { + settings = { + Lua = { + diagnostics = { + globals = { + 'vim' + } + } + } + } + }) + + 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 = { + enable = true, + experimental = { + enable = true, + } + } + } + } + }) + + vim.lsp.config("*", { + capabilities = capabilities, + on_attach = on_attach, + }) end, dependencies = { - 'williamboman/mason-lspconfig.nvim', + 'mason-org/mason-lspconfig.nvim', 'jay-babu/mason-nvim-dap.nvim', }, + lazy = false, } diff --git a/tmux.conf b/tmux.conf index 7bd0283..333d7a0 100644 --- a/tmux.conf +++ b/tmux.conf @@ -7,6 +7,7 @@ setw -gq utf8 on # Allow mouse interactions set -g mouse on +# Disable auto-renaming of windows set-option -g allow-rename # Bindings @@ -18,8 +19,12 @@ bind-key C-Space send-prefix ## More natural window splits bind \\ split-window -h -c "#{pane_current_path}" bind - split-window -v -c "#{pane_current_path}" + +## Remove original split shortcuts unbind '"' unbind % + +## Reload the config while inside of tmux bind r source-file ~/.tmux.conf; display-message "Config reloaded..." ## Better pane navigation @@ -32,9 +37,6 @@ bind -n C-M-l select-pane -R bind -n M-h previous-window bind -n M-l next-window -## Reload the config while inside of tmux -bind r source-file ~/.tmux.conf - # Plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' @@ -44,4 +46,5 @@ set -g @plugin 'egel/tmux-gruvbox' # Plugin settings # set -g @tmux-gruvbox 'dark-transparent' +## Required for TPM plugins run '~/.tmux/plugins/tpm/tpm' diff --git a/wezterm.lua b/wezterm.lua index b8bcedf..553263f 100644 --- a/wezterm.lua +++ b/wezterm.lua @@ -1,5 +1,8 @@ local wezterm = require 'wezterm' +local config = wezterm.config_builder() + +-- Fixing the cursor theme local xcursor_size = nil local xcursor_theme = nil @@ -25,8 +28,11 @@ if success then xcursor_size = tonumber(stdout) 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 = 'darkmatrix' -- config.color_scheme = 'Mashup Colors (terminal.sexy)' @@ -43,11 +49,9 @@ config.window_padding = { top = '0', bottom = '0' } +-- config.window_background_opacity = 0.9 +-- end visual options config.automatically_reload_config = true --- config.window_background_opacity = 0.9 -config.xcursor_theme = xcursor_theme -config.xcursor_size = xcursor_size - return config diff --git a/zshrc b/zshrc index 2acc9da..4cd3967 100644 --- a/zshrc +++ b/zshrc @@ -59,12 +59,14 @@ zstyle ':completion:*:warnings' format '%BNo matches for: %d%b' ### User configuration export EDITOR=nvim +export NVM_CONFIG_PREFIX=$HOME/.local/ # Paths to prepend to system path path=( $GOPATH/bin $HOME/.cargo/bin $HOME/.local/bin + $NVM_CONFIG_PREFIX/bin $path )