3 Commits

Author SHA1 Message Date
377aaf83cf feat: Starting the cleanup on DAP plugins and adding a basic statusline
to futz around with potential replacement of more external plugins.
2026-06-07 14:21:19 -05:00
e6e0ca0cca Merge branch 'main' into development 2026-06-07 14:20:56 -05:00
9f5007cbc3 feat: Adding the new FaultyBranches created note_taking plugin that may
take over for telekasten
2026-06-04 18:31:02 -05:00
23 changed files with 272 additions and 446 deletions

View File

@@ -7,9 +7,9 @@ Included are configs for:
- tmux
- wezterm
- zsh
- gitconfig
Planned configs are:
- gitconfig
- newsboat
## Deployment
@@ -97,12 +97,3 @@ The config adds the following settings outside of oh-my-zsh:
- `zsh_exports`: Exported variables for the system
- `zsh_functions`: Custom functions beyond simple aliasing can fulfill but not requiring a script
- `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
### Gitconfig
The gitconfig, centered on nvim integration, gives contains a selection of useful aliases and sets some basic defaults.
It also includes a local override config hosted at `~/.config/git/local` for adding username and email as well as any other options needed for a local machine.
> [!NOTE]
> For signing support put the `gpgsign` option in the local gitconfig

View File

@@ -17,7 +17,6 @@ declare -A configs=(
["nvim/snippets"]="$HOME/.config/nvim/"
["tmux.conf"]="$HOME/.tmux.conf"
["wezterm/wezterm.lua"]="$HOME/.config/wezterm/wezterm.lua"
["gitconfig"]="$HOME/.gitconfig"
)
declare -a config_directories=(

View File

@@ -1,46 +0,0 @@
[push]
default = simple
[core]
autocrlf = input
[filter "lfs"]
clean = git-lfs clean -- %f
process = git-lfs filter-process
required = true
smudge = git-lfs smudge -- %f
[pull]
rebase = false
[init]
defaultBranch = main
[alias]
c = commit
d = diff
dl = diff HEAD^ HEAD
ds = diff --staged
l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
s = status
branches = branch -avv
staash = stash --all
supdate = submodule update --remote
srupdate = submodule update --recursive
[merge]
tool = nvimdiff
[core]
editor = nvim
[rerere]
enabled = true
[include]
path = ~/.config/git/local
[commit]
gpgsign = true
# vim: ft=gitconfig

View File

@@ -3,16 +3,17 @@ return {
pylsp = {
plugins = {
pycodestyle = {
enabled = true,
enabled = false,
ignore = {
'E501' -- line-too-long
'E501'
},
maxLineLength = 120,
},
pylint = {
enabled = true,
args = {
'--disable=line-too-long,import-error',
'--disable=line-too-long',
'--disable=missing-function-docstring'
},
}
}

View File

@@ -1,43 +1,22 @@
-- Autocommands for handling large files and switching between large file buffers and others
local largefile_group = vim.api.nvim_create_augroup('largefile', { clear = true })
local max_filesize = 4 * (1024 * 1024) -- 4 MB
local old_eventignore = false
-- Disables syntax, treesitter and folding on larger files
vim.api.nvim_create_autocmd({ 'BufReadPre' }, {
group = largefile_group,
callback = function(ev)
if ev.file then
local status, size = pcall(function() return vim.loop.fs_stat(ev.file).size end)
if status and size > max_filesize then
old_eventignore = vim.o.eventignore
vim.o.eventignore = 'FileType' -- Reduce the calls for filetype specific plugins or syntax highlighting
pattern = '*',
group = vim.api.nvim_create_augroup('largefile', { clear = true }),
callback = function(args)
local max_filesize_MiB = 1
vim.b[ev.buf].is_large_file = true
vim.bo['bufhidden'] = 'unload'
vim.bo['buftype'] = 'nowrite'
vim.bo['swapfile'] = false
vim.bo['undofile'] = false
vim.bo['undolevels'] = -1
end
local _, stats = pcall(function()
return vim.loop.fs_stat(vim.api.nvim_buf_get_name(args.buf))
end)
local file_size = math.floor(0.5 + (stats.size / (1024 * 1024)))
if file_size > max_filesize_MiB then
print(string.format('File detected above %sMiB. Disabling syntax, treesitter, and folding.', max_filesize_MiB))
vim.api.nvim_command('set foldmethod=manual')
vim.api.nvim_command('set noswapfile')
vim.api.nvim_command('set noundofile')
vim.api.nvim_command('set noloadplugins')
end
end,
})
vim.api.nvim_create_autocmd({ 'BufWinEnter' }, {
group = largefile_group,
callback = function(ev)
if old_eventignore ~= false then
vim.o.eventignore = old_eventignore -- Restore the old setting
old_eventignore = false
end
if vim.b[ev.buf].is_large_file then
vim.wo.wrap = false
else
vim.wo.wrap = vim.o.wrap -- Restore to default setting
end
end
})
-- End large file handling

View File

@@ -10,7 +10,7 @@ end, { nargs = '*' })
vim.api.nvim_create_user_command('TreeSitterInstall', function(opts)
for index, value in ipairs(opts.fargs) do
if index > 0 then
local result = vim.system({ 'luarocks', '--local', '--lua-version', '5.1', 'install', 'tree-sitter-' .. value }, { text = true }):wait()
local result = vim.system({ 'luarocks', 'install', 'tree-sitter-' .. value }, { text = true }):wait()
if result.code == 0 then
print('Completed install of tree-sitter-' .. value)

View File

@@ -66,10 +66,3 @@ vim.keymap.set('n', '<leader>eo', ':Lexplore<CR>', options)
-- Allow for leaving Terminal mode using the escape key instead of the odd default
vim.keymap.set('t', '<Esc>', '<C-\\><C-n>')
local sc = require('statuscolumn')
vim.keymap.set('n', '<leader>q', function ()
print('woot')
sc.show_both_nums = not sc.show_both_nums
vim.opt.statuscolumn = "%!v:lua.require('statuscolumn').statusColumn()"
end)

View File

@@ -1,6 +1,7 @@
-- Load the following plugins eagerly to prevent visual oddities
require('plugins.gruvbox') -- Colorscheme setup
require('plugins.lualine') -- Status line plugin
-- require('statusline')
-- vim.schedule defers plugin loading for after the main loop starts
-- Startup is cleaner and faster than ever
@@ -13,18 +14,19 @@ vim.schedule(function()
require('plugins.telescope') -- Floating window fuzzy searching different sources
require('plugins.telekasten') -- Note taking plugin
require('plugins.mason') -- LSP and DAP manager
-- require('plugins.twilight') -- Focus mode, dim lines around the cursor's location
require('plugins.render-markdown') -- Render markdown directly in neovim
vim.pack.add({
'https://github.com/windwp/nvim-autopairs', -- Autocomplete symbol pairs when typing TODO: disabled for now, using snippets instead. remove if that feels better
'https://github.com/windwp/nvim-autopairs', -- Autocomplete symbol pairs when typing
'https://github.com/tpope/vim-surround', -- Change surrounding characters (doesn't need setup called)
'https://github.com/tpope/vim-fugitive', -- _The_ Git integration plugin people have been using forever
'https://github.com/habamax/vim-godot' -- Godot specific bindings and debug
})
require('nvim-autopairs').setup() -- Automatic pair completion of paranteticals, braces, quotes, etc.
require('plugins.dap') -- DAP debugging plugin
require('plugins.dap-python') -- Debug plugin settings specifically for python
require('plugins.dap') -- DAP debugging plugin TODO: cleanup
require('plugins.dap-python') -- Debug plugin settings specifically for python TODO: cleanup
-- Experimental
-- require('plugins.note_taking') -- In house note taking plugin (TODO: rename once the plugin name is solidified)

View File

@@ -5,6 +5,8 @@ vim.pack.add({
'https://github.com/theHamsta/nvim-dap-virtual-text',
})
-- TODO: Needs a pass to remove hardcoding, potentially cut out mason completely and general cleanup
require('dapui').setup({
mappings = {
open = 'o',
@@ -49,90 +51,90 @@ require('dapui').setup({
})
require('nvim-dap-virtual-text').setup()
-- local mason_dap = require('mason-nvim-dap')
local dap, dapui = require('dap'), require('dapui')
-- local mason_dap = require('mason-nvim-dap')
local dap, dapui = require('dap'), require('dapui')
-- mason_dap.setup({
-- ensure_installed = {
-- 'codelldb',
-- 'debugpy',
-- },
-- automatic_installation = true,
-- handlers = {
-- function(config)
-- require('mason-nvim-dap').default_setup(config)
-- end,
-- }
-- })
-- mason_dap.setup({
-- ensure_installed = {
-- 'codelldb',
-- 'debugpy',
-- },
-- automatic_installation = true,
-- handlers = {
-- function(config)
-- require('mason-nvim-dap').default_setup(config)
-- end,
-- }
-- })
dap.listeners.before.attach.dapui_config = function()
dapui.open()
end
dap.listeners.before.launch.dapui_config = function()
dapui.open()
end
dap.listeners.before.event_terminated.dapui_config = function()
dapui.close()
end
dap.listeners.before.event_exited.dapui_config = function()
dapui.close()
end
dap.listeners.before.attach.dapui_config = function()
dapui.open()
end
dap.listeners.before.launch.dapui_config = function()
dapui.open()
end
dap.listeners.before.event_terminated.dapui_config = function()
dapui.close()
end
dap.listeners.before.event_exited.dapui_config = function()
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('DapBreakpointCondition', { text = '🝌', texthl = '', lineh = '', numhl = '' })
vim.fn.sign_define('DapStopped', { text = '▶️' })
-- 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 = '▶️' })
dap.adapters.gdb = {
type = 'executable',
command = 'gdb',
args = { '-i', 'dap' },
dap.adapters.gdb = {
type = 'executable',
command = 'gdb',
args = { '-i', 'dap' },
}
dap.adapters.lldb = {
command = 'lldb',
type = 'executable',
}
dap.adapters.debugpy = {
command = 'debugpy',
type = 'executable',
}
dap.configurations = {
rust = {
{
type = 'lldb',
name = 'Debug',
request = 'launch',
program = function()
return vim.fn.getcwd() .. '/target/debug/faultybranches' -- TODO: remove the testing hardcoded path
end,
stopAtBeginningOfMainSubprogram = true,
},
},
python = {
{
type = 'python',
name = 'Launch current file',
request = 'launch',
program = '${file}',
pythonPath = function()
if vim.env.VIRTUAL_ENV then
return vim.env.VIRTUAL_ENV .. '/bin/python'
end
return vim.fn.exepath('python3') or vim.fn.exepath('python') or 'python'
end
}
}
}
dap.adapters.lldb = {
command = 'lldb',
type = 'executable',
}
dap.adapters.debugpy = {
command = 'debugpy',
type = 'executable',
}
dap.configurations = {
rust = {
{
type = 'lldb',
name = 'Debug',
request = 'launch',
program = function()
return vim.fn.getcwd() .. '/target/debug/faultybranches'
end,
stopAtBeginningOfMainSubprogram = true,
},
},
python = {
{
type = 'python',
name = 'Launch current file',
request = 'launch',
program = '${file}',
pythonPath = function()
if vim.env.VIRTUAL_ENV then
return vim.env.VIRTUAL_ENV .. '/bin/python'
end
return vim.fn.exepath('python3') or vim.fn.exepath('python') or 'python'
end
}
}
}
vim.keymap.set('n', '<leader>b', function ()
vim.keymap.set('n', '<leader>b', function()
require('dap').toggle_breakpoint()
end)
vim.keymap.set('n', '<leader>B', function() require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) end)
vim.keymap.set({'n', 'v'}, '<leader>dh', function() require('dap.ui.widgets').hover() end)
vim.keymap.set({ 'n', 'v' }, '<leader>dh', function() require('dap.ui.widgets').hover() end)
vim.keymap.set('n', '<F5>', function() require('dap').continue() end)
vim.keymap.set('n', '<F6>', function() require('dap').run_to_cursor() end)
vim.keymap.set('n', '<F8>', function() require('dap').terminate() end)

View File

@@ -1,7 +1,7 @@
-- Treesitter
local rocks_path = os.getenv('HOME') .. "/.luarocks/lib/luarocks/rocks-5.1"
-- Pick up the installed parsers in the install dir
-- Pick up the installed
for _, parser_dir in ipairs(vim.fn.glob(rocks_path .. '/tree-sitter-*/*/', true, true)) do
vim.opt.runtimepath:prepend(parser_dir)
end

View File

@@ -7,6 +7,7 @@ local function get_schema()
end
vim.pack.add({
-- 'https://github.com/nvim-tree/nvim-web-devicons',
'https://github.com/nvim-lualine/lualine.nvim'
})

View File

@@ -1,5 +1,5 @@
vim.pack.add({
'https://github.com/saadparwaiz1/cmp_luasnip',
-- 'https://github.com/saadparwaiz1/cmp_luasnip',
'https://github.com/rafamadriz/friendly-snippets',
'https://github.com/L3MON4D3/LuaSnip'
})
@@ -18,8 +18,7 @@ local function luasnip_dependency_update()
if out.code == 0 then
vim.notify('LuaSnip jsregexp built successfully!', vim.log.levels.INFO)
else
vim.notify('Failed to build LuaSnip jsregexp:\n' .. (out.stderr or out.stdout or ''),
vim.log.levels.ERROR)
vim.notify('Failed to build LuaSnip jsregexp:\n' .. (out.stderr or out.stdout or ''), vim.log.levels.ERROR)
end
end)
end)
@@ -43,6 +42,6 @@ require('luasnip.loaders.from_vscode').lazy_load()
require('luasnip.loaders.from_lua').lazy_load({ paths = "./snippets" })
-- TODO: Figure out keymappings that make sense
vim.keymap.set({ 'i' }, '<C-K>', function() require('luasnip').expand() end, { silent = true })
vim.keymap.set({ 'i', 's' }, '<C-L>', function() require('luasnip').jump(1) end, { silent = true })
vim.keymap.set({ 'i', 's' }, '<C-H>', function() require('luasnip').jump(-1) end, { silent = true })
vim.keymap.set({ 'i' }, '<C-k>', function() require('luasnip').expand() end, { silent = true })
vim.keymap.set({ 'i', 's' }, '<C-l>', function() require('luasnip').jump(1) end, { silent = true })
vim.keymap.set({ 'i', 's' }, '<C-j>', function() require('luasnip').jump(-1) end, { silent = true })

View File

@@ -16,6 +16,7 @@ require('mason-lspconfig').setup {
'marksman', -- markdown
'pylsp', -- Python
'rust_analyzer', -- Rust
'ts_ls', -- Typscript
'yamlls', -- YAML
}
}

View File

@@ -0,0 +1,6 @@
vim.pack.add({
-- 'https://git.faultybranches.dev/FaultyBranches_Public/faultynotes.git'
'~/repos/code/faultynotes'
})
require('faultynotes').setup()

View File

@@ -1,5 +1,6 @@
vim.pack.add({
-- 'https://github.com/kevinhwang91/nvim-bqf',
'https://github.com/kevinhwang91/nvim-bqf',
'https://github.com/nvim-telescope/telescope-file-browser.nvim',
'https://github.com/nvim-lua/plenary.nvim',
'https://github.com/nvim-telescope/telescope.nvim',
})
@@ -22,7 +23,9 @@ require('telescope').setup {
layout_config = { prompt_position = 'bottom' },
-- layout_strategy = 'vertical',
mappings = {
i = { ['<ESC>'] = require('telescope.actions').close, },
i = {
['<ESC>'] = require('telescope.actions').close,
},
},
prompt_prefix = '',
results_title = false,
@@ -32,6 +35,7 @@ require('telescope').setup {
},
pickers = {
diagnostics = {
-- theme = 'ivy',
initial_mode = 'normal',
layout_config = {
preview_cutoff = 9999,
@@ -42,12 +46,18 @@ require('telescope').setup {
local builtin = require('telescope.builtin')
vim.keymap.set('n', ';;', function() builtin.resume() end)
vim.keymap.set('n', ';b', function() builtin.buffers() end)
vim.keymap.set('n', ';d', function() builtin.diagnostics() end)
vim.keymap.set('n', ';f', function() builtin.find_files({ no_ignore = false, hidden = true }) end)
vim.keymap.set('n', ';h', function() builtin.help_tags() end)
vim.keymap.set('n', ';f', function()
builtin.find_files({
no_ignore = false,
hidden = true,
})
end)
vim.keymap.set('n', ';r', function() builtin.live_grep() end)
vim.keymap.set('n', ';s', function() builtin.lsp_document_symbols() end)
vim.keymap.set('n', ';b', function() builtin.buffers() end)
vim.keymap.set('n', ';h', function() builtin.help_tags() end)
vim.keymap.set('n', ';;', function() builtin.resume() end)
vim.keymap.set('n', ';d', function() builtin.diagnostics() end)
vim.keymap.set('n', ';t', function() builtin.treesitter() end)
vim.keymap.set('n', ';s', function() builtin.lsp_document_symbols() end)
vim.keymap.set('n', ';w', function() builtin.lsp_dynamic_workspace_symbols() end)

View File

@@ -1,47 +1,47 @@
-- Experimental
-- vim.o.autocomplete = true
vim.opt.background = 'dark' -- Force a dark background for the colorscheme
vim.opt.clipboard = 'unnamed,unnamedplus' -- Use both the "*" and "+" registers for yanks and deletes (puts things in the system clipboard)
vim.opt.completeopt = 'fuzzy,menuone,noinsert,popup' -- Change how the completion menu is interacted with and displays
vim.opt.cursorcolumn = true -- Highlight the column the cursor is on
vim.opt.cursorline = true -- Highlight the line the cursor is on.
vim.opt.expandtab = true -- Expand tabs into spaces
vim.opt.fileformat = 'unix' -- Explicitly state that files should use the unix style EOL characters.
vim.opt.fillchars = 'fold: ' -- Sets the character that fills in a fold line (removes the dots)
vim.opt.foldcolumn = '0' -- Disables the foldcolumn
vim.opt.foldexpr = 'v:lua.vim.treesitter.foldexpr()' -- Uses Treesitter to determine where code folding should occur
vim.opt.foldlevel = 10 -- Sets the initial level at which folds will be closed
vim.opt.foldlevelstart = 4 -- Sets the initial fold level
vim.opt.foldmethod = 'expr' -- Attempt to use the syntax of a file to set folds.
vim.opt.foldnestmax = 4 -- Maximum level of fold nesting
vim.opt.formatoptions = 'cqrto' -- Allow auto insertion of comment lines when using o or O on a comment.
vim.opt.ignorecase = true -- Case-insensitive searching
vim.opt.list = true -- Show the listchars
vim.opt.listchars = 'tab:|·,trail:¬,extends:»,precedes:«,nbsp:+' -- Characters to display when showing whitespace
vim.opt.mouse = 'a' -- Enable mouse mode
vim.opt.number = true -- Show the line number in the gutter.
vim.opt.pumheight = 15 -- Maximum height of the auto complete floating window
vim.opt.relativenumber = true -- Show the relative line numbers
vim.opt.sidescrolloff = 8 -- Side scrolling leadoff to keep the cursor a few characters from the screen edge instead of going all the way to it
vim.opt.shiftround = true -- Round indentation to shiftwidth
vim.opt.shiftwidth = 4 -- Number of spaces a tab counts for when converting tabs to spaces
vim.opt.shortmess = 'at' -- Abbreviations and truncation of cmd messages
vim.opt.showmatch = true -- Show matching bracket
vim.opt.signcolumn = 'yes' -- Always show the gutter
vim.opt.smartcase = true -- Keeps searches Case-insensitive until the search has an upper case character
vim.opt.smartindent = true -- Attempt to insert indentation to fit traditional languages.
vim.opt.softtabstop = 4 -- Number of spaces a tab counts for when converting tabs to spaces
vim.opt.splitbelow = true -- Split windows below when horizontal splitting
vim.opt.splitright = true -- Split windows right when vertical splitting
vim.opt.swapfile = false -- Disable the creation of swap files for open files
vim.opt.tabstop = 4 -- Setting the value of spaces per tab
vim.opt.termguicolors = true -- Enable the truecolor GUI colors in a terminal
vim.opt.undodir = os.getenv('HOME') .. '/.config/nvim/undodir' -- Set a specific undo file directory
vim.opt.undofile = true -- Enable undo files
vim.opt.updatetime = 300 -- Swapfile update time in milliseconds
vim.opt.wrap = false -- Do _not_ wrap lines
vim.opt.background = 'dark' -- Force a dark background for the colorscheme
vim.opt.clipboard = 'unnamed,unnamedplus' -- Use both the "*" and "+" registers for yanks and deletes (puts things in the system clipboard)
vim.opt.completeopt = 'fuzzy,menuone,noinsert,popup' -- Change how the completion menu is interacted with and displays
vim.opt.cursorcolumn = true -- Highlight the column the cursor is on
vim.opt.cursorline = true -- Highlight the line the cursor is on.
vim.opt.expandtab = true -- Expand tabs into spaces
vim.opt.fileformat = 'unix' -- Explicitly state that files should use the unix style EOL characters.
-- vim.opt.fillchars = 'fold: ' -- Sets the character that fills in a fold line (removes the dots)
vim.opt.foldcolumn = '0' -- Disables the foldcolumn
vim.opt.foldexpr = 'v:lua.vim.treesitter.foldexpr()' -- Uses Treesitter to determine where code folding should occur
vim.opt.foldlevel = 10 -- Sets the initial level at which folds will be closed
vim.opt.foldlevelstart = 4 -- Sets the initial fold level
vim.opt.foldmethod = 'expr' -- Attempt to use the syntax of a file to set folds.
vim.opt.foldnestmax = 4 -- Maximum level of fold nesting
vim.opt.formatoptions = 'cqrto' -- Allow auto insertion of comment lines when using o or O on a comment.
vim.opt.ignorecase = true -- Case-insensitive searching
vim.opt.list = true -- Show the listchars
vim.opt.listchars = 'tab:|·,trail:¬,extends:»,precedes:«,nbsp:+' -- Characters to display when showing whitespace
vim.opt.mouse = 'a' -- Enable mouse mode
vim.opt.number = true -- Show the line number in the gutter.
vim.opt.pumheight = 15 -- Maximum height of the auto complete floating window
vim.opt.relativenumber = true -- Relative line number
vim.opt.sidescrolloff = 8 -- Side scrolling leadoff to keep the cursor a few characters from the screen edge instead of going all the way to it
vim.opt.shiftround = true -- Round indentation to shiftwidth
vim.opt.shiftwidth = 4 -- Number of spaces a tab counts for when converting tabs to spaces
vim.opt.shortmess = 'at' -- Abbreviations and truncation of cmd messages
vim.opt.showmatch = true -- Show matching bracket
vim.opt.signcolumn = 'yes' -- Always show the gutter
vim.opt.smartcase = true -- Keeps searches Case-insensitive until the search has an upper case character
vim.opt.smartindent = true -- Attempt to insert indentation to fit traditional languages.
vim.opt.softtabstop = 4 -- Number of spaces a tab counts for when converting tabs to spaces
vim.opt.splitbelow = true -- Split windows below when horizontal splitting
vim.opt.splitright = true -- Split windows right when vertical splitting
vim.opt.swapfile = false -- Disable the creation of swap files for open files
vim.opt.tabstop = 4 -- Setting the value of spaces per tab
vim.opt.termguicolors = true -- Enable the truecolor GUI colors in a terminal
vim.opt.undodir = os.getenv('HOME') .. '/.config/nvim/undodir' -- Set a specific undo file directory
vim.opt.undofile = true -- Enable undo files
vim.opt.updatetime = 300 -- Swapfile update time in milliseconds
vim.opt.wrap = false -- Do _not_ wrap lines
vim.g.netrw_banner = 0 -- Remove the banner
vim.g.netrw_liststyle = 3 -- Use the tree style display for netrw directory listings
vim.g.netrw_winsize = 25 -- Percentage based pane size for directory exploring
vim.g.netrw_banner = 0
vim.g.netrw_liststyle = 3 -- Use the tree style display for netrw directory listings
vim.g.netrw_winsize = 25 -- Percentage based pane size for directory exploring

View File

@@ -1,81 +0,0 @@
local statuscolumn = {}
local show_both_nums = false
statuscolumn.setHL = function ()
local colors = {
'#888cd8',
'#8081cd',
'#7877c2',
'#706cb7',
'#6862ad',
'#6057a2',
'#584d97',
'#50438d',
'#493a82',
'#413078',
}
for i, color in ipairs(colors) do
vim.api.nvim_set_hl(0, 'Gradient_' .. i, { fg = color })
end
end
statuscolumn.border = function()
-- if vim.v.relnum < 9 then
-- return '%#Gradient_' .. (vim.v.relnum + 1) .. '#│'
-- else
-- return '%#Gradient_10#│'
-- end
return ''
end
statuscolumn.folds = function()
local foldlevel = vim.fn.foldlevel(vim.v.lnum)
local foldlevel_before = vim.fn.foldlevel((vim.v.lnum - 1) >= 1 and vim.v.lnum - 1 or 1)
local foldlevel_after = vim.fn.foldlevel((vim.v.lnum + 1) <= vim.fn.line('$') and (vim.v.lnum + 1) or vim.fn.line('$'))
local foldclosed = vim.fn.foldclosed(vim.v.lnum)
if foldlevel == 0 then
return ' '
end
if foldclosed ~= -1 and foldclosed == vim.v.lnum then
return ''
end
if foldlevel > foldlevel_before then
return ''
end
if foldlevel > foldlevel_after then
return ''
end
return ''
end
statuscolumn.numbers = function()
if show_both_nums then
return string.format('%-3s %2s ', vim.v.lnum, vim.v.relnum)
else
return string.format('%2s', vim.v.relnum)
end
end
statuscolumn.statusColumn = function()
local column_text = ''
-- statuscolumn.setHL()
column_text = table.concat({
'%s',
statuscolumn.numbers(),
-- statuscolumn.border(),
-- statuscolumn.folds(), ' ',
})
return column_text
end
return statuscolumn

26
nvim/lua/statusline.lua Normal file
View File

@@ -0,0 +1,26 @@
local function lsp_status()
local attached_clients = vim.lsp.get_clients({ bufnr = 0 })
if #attached_clients == 0 then
return ''
end
local names = vim.iter(attached_clients)
:map(function (client)
local name = client.name:gsub('language.server', 'ls')
return name
end)
:totable()
return '[' .. table.concat(names, ', ') .. ']'
end
function _G.statusline()
return table.concat({
'%f',
'%h%w%m%r',
'%=',
lsp_status(),
' %-14(%l,%c%V%)',
'%P',
}, ' ')
end
vim.o.statusline = '%{%v:lua._G.statusline()%}'

View File

@@ -1,37 +0,0 @@
-- require('luasnip.session.snippet_collection').clear_snippets('all')
-- local ls = require('luasnip')
-- local s = ls.snippet
-- local sn = ls.snippet_node
-- local i = ls.insert_node
-- local t = ls.text_node
-- local c = ls.choice_node
-- local r = ls.restore_node
--
-- -- Replacement of autopairs
-- local function pair(pair_begin, pair_end)
-- -- Auto-pair using snippets
-- return s({ trig = pair_begin, wordTrig = false }, {
-- t({ pair_begin }),
-- c(1, {
-- r(1, "content", i(1)),
-- sn(nil, { t({"", "\t"}), r(1, "content", i(1)), t({ "", "" }) }),
-- }),
-- t({ pair_end }),
-- })
-- end
--
-- ls.add_snippets('all', {
-- pair('(', ')'),
-- pair('{', '}'),
-- pair('[', ']'),
-- pair('<', '>'),
-- pair("'", "'"),
-- pair('"', '"'),
-- pair('`', '`'),
-- }, {
-- -- type = 'autosnippets',
-- -- key = 'all_auto',
-- })
-- end autopairs

View File

@@ -1,36 +1,44 @@
local ls = require('luasnip')
local s = ls.snippet
-- local sn = ls.snippet_node
local i = ls.insert_node
local t = ls.text_node
-- local l = require('luasnip.extras').lambda
local l = require('luasnip.extras').lambda
local fmt = require('luasnip.extras.fmt').fmt
-- local ts_post = require('luasnip.extras.treesitter_postfix').treesitter_postfix
local ts_post = require('luasnip.extras.treesitter_postfix').treesitter_postfix
ls.add_snippets('python', {
s('docstring single', {
t("''' "), i(0, 'text'), t(" '''")
}),
s('def', fmt([[
def {func}({args}) -> {ret}:
''' {doc} '''
{body}
return {
ts_post({
matchTSNode = {
query = [[
(function_definition
parameters: (parameters) @params
return_type: (type) @return
) @prefix
]],
query_lang = "python",
},
trig = "docstring",
}, fmt([[
''' {}
Keyword arguments:
{} () -
Return:
{} - {}
'''
]], {
func = i(1, 'fname'),
args = i(2),
ret = i(3, 'None'),
doc = i(4, 'docstring'),
body = i(5, 'pass'),
}, {
i(1, 'Description'),
l(l.LS_TSCAPTURE_PARAMS),
l(l.LS_TSCAPTURE_RETURN),
l(l.LS_TSDATA),
})),
s('ternary', {
i(1, 'then'), t(' if '), i(2, 'condition'), t(' else '), i(3, 'else')
}),
s('tuple ternary', fmt([[
({if_true}, {if_false})[{condition}]
]], {
if_true = i(1, 'if_true'),
if_false = i(2, 'if_false'),
condition = i(3, 'condition'),
})),
})
-- s(
-- { trig = "thingy" },
-- { t('Woot!') }
-- ),
-- s(
-- { trig = 'thingy2' },
-- { t('Woot2!') }
-- )
}

View File

@@ -1,33 +1,12 @@
# True color support
set-option -ga terminal-overrides ',xterm-*:Tc'
set-option -g default-terminal 'tmux-256color'
set-option -ga terminal-overrides ',xterm-256color:Tc'
# Set encoding to Unicode8
setw -gq utf8 on
set -g status-interval 5
set -g display-time 4000
# Numbering changes
set -g base-index 1
set -g pane-base-index 1
set -g renumber-windows on
# History lengthening from the default 2k
set -g history-limit 50000
setw -g mode-keys vi
set -g focus-events on
# Window resizing on host shell size changes TODO: needs testing with pair coding
set -g window-size latest
setw -g aggressive-resize on
# set -g default-command 'reattach-to-user-namespace -l $SHELL' # TODO: Is this necessary for Mac still?
# Allow for external system clipboard
set-option -g set-clipboard external
# set-option -g allow-passthrough on
# Allow mouse interactions
set -g mouse on
@@ -58,6 +37,7 @@ bind -n M-l next-window
# Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'egel/tmux-gruvbox'

View File

@@ -1,10 +1,10 @@
local wezterm = require 'wezterm'
local act = wezterm.action
local config = wezterm.config_builder()
-- Visual options
config.color_scheme = 's3r0 modified (terminal.sexy)'
-- config.color_scheme = 'Mashup Colors (terminal.sexy)'
config.font = wezterm.font 'Inconsolata Nerd Font Mono'
config.font_size = 12
@@ -25,36 +25,34 @@ config.automatically_reload_config = true
-- Linux specific fixes
if wezterm.target_triple == 'x86_64-unknown-linux-gnu' then
-- Fixing the cursor theme
-- local xcursor_size = nil
-- local xcursor_theme = nil
--
-- local theme_success, stdout, _ = wezterm.run_child_process({
-- "gsettings",
-- "get",
-- "org.gnome.desktop.interface",
-- "cursor-theme"
-- })
--
-- if theme_success then
-- xcursor_theme = stdout:gsub("'(.+)'\n", "%1")
-- end
--
-- local cursor_success, _, _ = wezterm.run_child_process({
-- "gsettings",
-- "get",
-- "org.gnome.desktop.interface",
-- "cursor-size"
-- })
--
-- if cursor_success then
-- xcursor_size = tonumber(stdout)
-- end
--
-- config.xcursor_theme = xcursor_theme
-- config.xcursor_size = xcursor_size
-- end cursor theme
local xcursor_size = nil
local xcursor_theme = nil
config.disable_default_key_bindings = true
local theme_success, stdout, _ = wezterm.run_child_process({
"gsettings",
"get",
"org.gnome.desktop.interface",
"cursor-theme"
})
if theme_success then
xcursor_theme = stdout:gsub("'(.+)'\n", "%1")
end
local cursor_success, _, _ = wezterm.run_child_process({
"gsettings",
"get",
"org.gnome.desktop.interface",
"cursor-size"
})
if cursor_success then
xcursor_size = tonumber(stdout)
end
config.xcursor_theme = xcursor_theme
config.xcursor_size = xcursor_size
-- end cursor theme
end
local local_config_filename = os.getenv('HOME') .. '/.config/wezterm/local.lua'
@@ -64,9 +62,4 @@ if local_config ~= nil then
config = local_setup.setup(config)
end
config.keys = {
{key = 'V', mods = 'CTRL', action = act.PasteFrom 'Clipboard'},
{key = 'V', mods = 'CTRL', action = act.PasteFrom 'PrimarySelection'},
}
return config

View File

@@ -1,4 +1,3 @@
export EDITOR=nvim
export MANPAGER="less -R --use-color -Dd+r -Du+b" # Colored MAN pages
export DOCKER_DEFAULT_PLATFORM=linux/amd64
export GPG_TTY=$(tty)