You've already forked dotfiles
Compare commits
3 Commits
main
...
developmen
| Author | SHA1 | Date | |
|---|---|---|---|
| 377aaf83cf | |||
| e6e0ca0cca | |||
| 9f5007cbc3 |
@@ -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=(
|
||||
|
||||
43
gitconfig
43
gitconfig
@@ -1,43 +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
|
||||
|
||||
# vim: ft=gitconfig
|
||||
@@ -3,9 +3,9 @@ return {
|
||||
pylsp = {
|
||||
plugins = {
|
||||
pycodestyle = {
|
||||
enabled = true,
|
||||
enabled = false,
|
||||
ignore = {
|
||||
'E501' -- line-too-long
|
||||
'E501'
|
||||
},
|
||||
maxLineLength = 120,
|
||||
},
|
||||
@@ -13,6 +13,7 @@ return {
|
||||
enabled = true,
|
||||
args = {
|
||||
'--disable=line-too-long',
|
||||
'--disable=missing-function-docstring'
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
@@ -17,13 +18,15 @@ vim.schedule(function()
|
||||
require('plugins.render-markdown') -- Render markdown directly in neovim
|
||||
|
||||
vim.pack.add({
|
||||
'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('plugins.dap') -- DAP debugging plugin
|
||||
require('plugins.dap-python') -- Debug plugin settings specifically for python
|
||||
require('nvim-autopairs').setup() -- Automatic pair completion of paranteticals, braces, quotes, etc.
|
||||
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)
|
||||
|
||||
@@ -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',
|
||||
@@ -106,7 +108,7 @@ require('nvim-dap-virtual-text').setup()
|
||||
name = 'Debug',
|
||||
request = 'launch',
|
||||
program = function()
|
||||
return vim.fn.getcwd() .. '/target/debug/faultybranches'
|
||||
return vim.fn.getcwd() .. '/target/debug/faultybranches' -- TODO: remove the testing hardcoded path
|
||||
end,
|
||||
stopAtBeginningOfMainSubprogram = true,
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 })
|
||||
|
||||
@@ -16,6 +16,7 @@ require('mason-lspconfig').setup {
|
||||
'marksman', -- markdown
|
||||
'pylsp', -- Python
|
||||
'rust_analyzer', -- Rust
|
||||
'ts_ls', -- Typscript
|
||||
'yamlls', -- YAML
|
||||
}
|
||||
}
|
||||
|
||||
6
nvim/lua/plugins/note_taking.lua
Normal file
6
nvim/lua/plugins/note_taking.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
vim.pack.add({
|
||||
-- 'https://git.faultybranches.dev/FaultyBranches_Public/faultynotes.git'
|
||||
'~/repos/code/faultynotes'
|
||||
})
|
||||
|
||||
require('faultynotes').setup()
|
||||
26
nvim/lua/statusline.lua
Normal file
26
nvim/lua/statusline.lua
Normal 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()%}'
|
||||
@@ -1,36 +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
|
||||
@@ -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!') }
|
||||
-- )
|
||||
}
|
||||
|
||||
@@ -53,8 +53,6 @@ if wezterm.target_triple == 'x86_64-unknown-linux-gnu' then
|
||||
config.xcursor_theme = xcursor_theme
|
||||
config.xcursor_size = xcursor_size
|
||||
-- end cursor theme
|
||||
|
||||
config.disable_default_key_bindings = true
|
||||
end
|
||||
|
||||
local local_config_filename = os.getenv('HOME') .. '/.config/wezterm/local.lua'
|
||||
|
||||
Reference in New Issue
Block a user