chore: organize dotfiles stowed by home-manager

This commit is contained in:
TheGeneralist 2025-06-23 09:21:16 +02:00
parent d82367b7ee
commit c8783b2c52
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
40 changed files with 32 additions and 59 deletions

231
modules/dotfiles/i3/config Normal file
View file

@ -0,0 +1,231 @@
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod1
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 8
# GET DEM BORDERS OUT OF HEREc:w
#
# Thanks Childz
for_window [class="^.*"] border pixel 2
# class border backgr. text indicator child_border
for_window [class="^.*"] client.focused #77dd77 #285577 #ffffff #2e9ef4 #285577
for_window [class="pinentry-qt"] floating enable
for_window [window_role="pop-up"] floating enable
for_window [window_role="bubble"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [window_role="Preferences"] floating enable
for_window [window_type="dialog"] floating enable
for_window [window_type="menu"] floating enable
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Start XDG autostart .desktop files using dex. See also
# https://wiki.archlinux.org/index.php/XDG_Autostart
exec --no-startup-id dex --autostart --environment i3
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
# they are included here as an example. Modify as you see fit.
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.
exec --no-startup-id nm-applet
#set $refresh_i3status killall -SIGUSR1 i3status
# Use pactl to adjust volume in PulseAudio.
exec --no-startup-id sxhkd
bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause
bindsym XF86AudioStop exec --no-startup-id playerctl stop
bindsym XF86AudioNext exec --no-startup-id playerctl next
bindsym XF86AudioPrev exec --no-startup-id playerctl previous
bindsym XF86AudioRaiseVolume exec --no-startup-id wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
bindsym XF86AudioLowerVolume exec --no-startup-id wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bindsym XF86AudioMute exec --no-startup-id wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
# bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Return exec ghostty
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
# bindsym $mod+d exec --no-startup-id dmenu_run
# A more modern dmenu replacement is rofi:
bindcode $mod+40 exec "rofi -modi drun,run -show drun"
# There also is i3-dmenu-desktop which only displays applications shipping a
# .desktop file. It is a wrapper around dmenu, so you need that installed.
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+Ctrl+h focus left
bindsym $mod+Ctrl+j focus down
bindsym $mod+Ctrl+k focus up
bindsym $mod+Ctrl+l focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Ctrl+Left focus left
bindsym $mod+Ctrl+Down focus down
bindsym $mod+Ctrl+Up focus up
bindsym $mod+Ctrl+Right focus right
# move focused window
bindsym $mod+Ctrl+Shift+h move left
bindsym $mod+Ctrl+Shift+j move down
bindsym $mod+Ctrl+Shift+k move up
bindsym $mod+Ctrl+Shift+l move right
# alternatively, you can use the cursor keys:
bindsym $mod+Ctrl+Shift+Left move left
bindsym $mod+Ctrl+Shift+Down move down
bindsym $mod+Ctrl+Shift+Up move up
bindsym $mod+Ctrl+Shift+Right move right
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
set $ws11 "11"
# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
bindsym $mod+Shift+F11 workspace number $ws11
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
bindsym $mod+Ctrl+Shift+F11 move container to workspace number $ws11
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
status_command i3status
# status_command i3blocks
tray_output primary
}
bindsym ISO_Next_Group exec pkill -RTMIN+1 i3blocks
################
# CUSTOM
# MAPPINGS
################
# Keyboard layouts
exec_always "setxkbmap -layout us,ru -option grp:win_space_toggle"
# Screenshot keybind
bindsym --release Print exec flameshot gui
exec --no-startup-id feh --bg-scale /usr/share/psycho_mask.jpg
exec_always --no-startup-id xset r rate 200 25
exec vmware-user-suid-wrapper --no-startup-id
exec --no-startup-id xrdb -merge /home/thegeneralist01/.Xresources

View file

@ -0,0 +1,5 @@
#!/bin/sh
# Detect primary or fallback to first connected output
OUTPUT=$(xrandr --query | awk '/ connected/{print $1; exit}')
exec i3bar --tray_output "$OUTPUT"

View file

@ -0,0 +1,32 @@
general {
interval = 5
colors = true
}
order += "cpu_usage"
order += "memory"
order += "disk /"
order += "tztime local"
#order += "keyboard_layout"
cpu_usage {
format = "CPU: %usage"
}
memory {
format = "RAM: %used/%total"
}
disk "/" {
format = "Disk: %avail"
}
tztime local {
format = "%Y-%m-%d %H:%M:%S %Z"
}
#keyboard_layout {
# format = "LANG: %s"
# interval = 1
# exec = "xkblayout-state print '%s'"
#}

View file

@ -0,0 +1,18 @@
local bufnr = vim.api.nvim_get_current_buf()
vim.keymap.set(
"n",
"<leader>a",
function()
vim.cmd.RustLsp('codeAction') -- supports rust-analyzer's grouping
-- or vim.lsp.buf.codeAction() if you don't want grouping.
end,
{ silent = true, buffer = bufnr }
)
vim.keymap.set(
"n",
"K", -- Override Neovim's built-in hover keymap with rustaceanvim's hover actions
function()
vim.cmd.RustLsp({ 'hover', 'actions' })
end,
{ silent = true, buffer = bufnr }
)

View file

@ -0,0 +1 @@
require("thegeneralist")

View file

@ -0,0 +1,55 @@
{
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"avante.nvim": { "branch": "main", "commit": "a60a8d470160a5f7aa6ceec019095dbd7563e3e0" },
"blink.cmp": { "branch": "main", "commit": "49f211fe5d729df53df4c042d7c3464cf47d199e" },
"catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" },
"cellular-automaton.nvim": { "branch": "main", "commit": "1606e9d5d04ff254023c3f3c62842d065708d6d3" },
"copilot.vim": { "branch": "release", "commit": "5015939f131627a6a332c9e3ecad9a7cb4c2e549" },
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
"editorconfig.nvim": { "branch": "master", "commit": "67758c3e8a2f79019322a60013e4ce0aad09dafa" },
"fine-cmdline.nvim": { "branch": "main", "commit": "aec9efebf6f4606a5204d49ffa3ce2eeb7e08a3e" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"gh.nvim": { "branch": "main", "commit": "6f367b2ab8f9d4a0a23df2b703a3f91137618387" },
"harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
"img-clip.nvim": { "branch": "main", "commit": "24c13df08e3fe66624bed5350a2a780f77f1f65b" },
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
"litee.nvim": { "branch": "main", "commit": "4efaf373322d9e71eaff31164abb393417cc6f6a" },
"lspkind-nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
"lualine.nvim": { "branch": "master", "commit": "9fef261b53fbe3a2ef01ee9667f6fde064b1ed10" },
"luvit-meta": { "branch": "main", "commit": "1df30b60b1b4aecfebc785aa98943db6c6989716" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" },
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
"neogen": { "branch": "main", "commit": "05d754004da8c89115b291f2a23ca530a8cac8fd" },
"nerdfont.vim": { "branch": "master", "commit": "3605ba4ba4dc0295f5eb400506fd05b451df3e1f" },
"none-ls-extras.nvim": { "branch": "main", "commit": "6557f20e631d2e9b2a9fd27a5c045d701a3a292c" },
"none-ls.nvim": { "branch": "main", "commit": "a117163db44c256d53c3be8717f3e1a2a28e6299" },
"nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" },
"nvim-cmp": { "branch": "main", "commit": "1e1900b0769324a9675ef85b38f99cca29e203b3" },
"nvim-dap": { "branch": "master", "commit": "6a5bba0ddea5d419a783e170c20988046376090d" },
"nvim-dap-probe-rs": { "branch": "master", "commit": "6df52c49755d78a2d7754c0630dd58694ea39ada" },
"nvim-dap-python": { "branch": "master", "commit": "34282820bb713b9a5fdb120ae8dd85c2b3f49b51" },
"nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-notify": { "branch": "master", "commit": "22f29093eae7785773ee9d543f8750348b1a195c" },
"nvim-treesitter": { "branch": "master", "commit": "b10436b9fb29d3c3c406c07ce813f70245f9bc7b" },
"nvim-web-devicons": { "branch": "master", "commit": "4c3a5848ee0b09ecdea73adcd2a689190aeb728c" },
"oil.nvim": { "branch": "master", "commit": "ab887d926c2665a708fbe9e6c4654042cc5f4c60" },
"plenary": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
"rose-pine": { "branch": "main", "commit": "7d1b5c7dcd274921f0f58e90a8bf935f6a95fbf3" },
"rustaceanvim": { "branch": "master", "commit": "448c76451ecf3c0edabcde427b7f1c8c219be2dd" },
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
"undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" },
"vim-easy-align": { "branch": "master", "commit": "9815a55dbcd817784458df7a18acacc6f82b1241" },
"vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" },
"which-key.nvim": { "branch": "main", "commit": "af4ded85542d40e190014c732fa051bdbf88be3d" }
}

View file

@ -0,0 +1,3 @@
{
"workspace.checkThirdParty": false
}

View file

@ -0,0 +1,77 @@
require("thegeneralist.remap")
require("thegeneralist.set")
require("thegeneralist.lazy_init")
local augroup = vim.api.nvim_create_augroup
local thegeneralist_group = augroup('thegeneralist', {})
local autocmd = vim.api.nvim_create_autocmd
local yank_group = augroup('HighlightYank', {})
autocmd('TextYankPost', {
group = yank_group,
pattern = '*',
callback = function()
vim.highlight.on_yank({
higroup = 'IncSearch',
timeout = 40,
})
end,
})
autocmd({ "BufWritePre" }, {
group = thegeneralist_group,
pattern = "*",
command = [[%s/\s\+$//e]],
})
autocmd('LspAttach', {
group = thegeneralist_group,
callback = function(e)
-- @param desc string
local function opts(desc)
return {
buffer = e.buf,
--noremap = true, -- Not sure about this
desc = "[LSP] " .. desc
}
end
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts("Go to Definition"))
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts("Go to Declaration"))
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts("Hover info"))
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts("Workspace Symbol"))
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts("Open float?"))
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts("View code actions"))
vim.keymap.set("i", "<C-]>", function() vim.lsp.buf.code_action() end, opts("View code actions"))
vim.keymap.set("n", "<leader>va", function()
-- TODO: this
local params = vim.lsp.util.make_range_params()
params.context = { diagnostics = vim.lsp.diagnostic.get_line_diagnostics() }
local result, err = vim.lsp.buf_request_sync(0, "textDocument/codeAction", params, 1000)
if result and result[1] and result[1].result and result[1].result[1] then
local first_action = result[1].result[1]
vim.lsp.buf.execute_command(first_action.command)
else
print("No code actions available")
end
end, opts("Apply 1st code action"))
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts("Show references"))
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts("Rename"))
vim.keymap.set("n", "[d", function()
vim.diagnostic.jump({
count = 1,
float = true,
})
end, opts("Previous diagnostic"))
vim.keymap.set("n", "]d", function()
vim.diagnostic.jump({
count = -1,
float = true,
})
end, opts("Next diagnostic"))
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts("Signature help"))
vim.keymap.set("n", "<leader>h", function() vim.lsp.buf.signature_help() end, opts("Signature help"))
end
})

View file

@ -0,0 +1,80 @@
return {
-- {
-- "MeanderingProgrammer/render-markdown.nvim",
-- opts = {
-- file_types = { "markdown", "Avante" },
-- },
-- ft = { "markdown", "Avante" },
-- },
-- {
-- "yetone/avante.nvim",
-- ---@alias Provider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string
-- event = "VeryLazy",
-- lazy = false,
-- opts = {
-- provider = "copilot",
-- mappings = {
-- diff = {
-- ours = "<leader>co",
-- theirs = "<leader>ct",
-- all_theirs = "<leader>ca",
-- both = "<leader>cb",
-- cursor = "<leader>cc",
-- next = "]x",
-- prev = "[x",
-- },
-- ask = "<leader>Aa",
-- edit = "<leader>Ae",
-- refresh = "<leader>Ar",
-- toggle = {
-- default = "<leader>At",
-- debug = "<leader>Ad",
-- hint = "<leader>Ah",
-- suggestion = "<leader>As",
-- },
-- },
-- behaviour = {
-- auto_suggestions = false,
-- },
-- hints = { enabled = false },
-- },
-- branch = "main",
-- -- commit = "ff316f91101fcc328d1e7879ab1bf26a055c2745",
-- -- if you want to download pre-built binary, then pass source=false. Make sure to follow instruction above.
-- -- Also note that downloading prebuilt binary is a lot faster comparing to compiling from source.
-- build = ":AvanteBuild source=false",
-- dependencies = {
-- "stevearc/dressing.nvim",
-- "nvim-lua/plenary.nvim",
-- "MunifTanjim/nui.nvim",
-- --- The below dependencies are optional,
-- "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
-- -- "zbirenbaum/copilot.lua", -- for providers='copilot'
-- {
-- -- support for image pasting
-- "HakonHarnes/img-clip.nvim",
-- event = "VeryLazy",
-- opts = {
-- -- recommended settings
-- default = {
-- embed_image_as_base64 = false,
-- prompt_for_file_name = false,
-- drag_and_drop = {
-- insert_mode = true,
-- },
-- -- required for Windows users
-- use_absolute_path = true,
-- },
-- },
-- },
-- {
-- -- Make sure to setup it properly if you have lazy=true
-- "MeanderingProgrammer/render-markdown.nvim",
-- opts = {
-- file_types = { "markdown", "Avante" },
-- },
-- ft = { "markdown", "Avante" },
-- },
-- },
-- },
}

View file

@ -0,0 +1,84 @@
return {
{
"saghen/blink.cmp",
dependencies = { "rafamadriz/friendly-snippets" },
version = "1.*",
opts = {
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
-- 'super-tab' for mappings similar to vscode (tab to accept)
-- 'enter' for enter to accept
-- 'none' for no mappings
--
-- All presets have the following mappings:
-- C-space: Open menu or open docs if already open
-- C-n/C-p or Up/Down: Select next/previous item
-- C-e: Hide menu
-- C-k: Toggle signature help (if signature.enabled = true)
--
-- See :h blink-cmp-config-keymap for defining your own keymap
keymap = { preset = "default" },
appearance = {
nerd_font_variant = "mono",
},
-- (Default) Only show the documentation popup when manually triggered
completion = { documentation = { auto_show = true } },
-- Default list of enabled providers defined so that you can extend it
-- elsewhere in your config, without redefining it, due to `opts_extend`
sources = {
default = { "lsp", "path", "snippets", "buffer" },
},
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
--
-- See the fuzzy documentation for more information
fuzzy = { implementation = "prefer_rust_with_warning" },
},
opts_extend = { "sources.default" },
},
-- {
-- 'neovim/nvim-lspconfig',
-- dependencies = {
-- 'saghen/blink.cmp',
-- 'williamboman/mason.nvim',
-- 'mason-org/mason-registry',
-- 'williamboman/mason-lspconfig.nvim',
-- 'L3MON4D3/LuaSnip',
-- 'saadparwaiz1/cmp_luasnip',
-- 'j-hui/fidget.nvim',
-- },
--
-- -- example using `opts` for defining servers
-- opts = {
-- servers = {
-- lua_ls = {}
-- }
-- },
-- config = function(_, opts)
-- require("fidget").setup({})
-- require("mason").setup()
--
-- local lspconfig = require('mason-lspconfig')
-- for server, config in pairs(opts.servers) do
-- -- passing config.capabilities to blink.cmp merges with the capabilities in your
-- -- `opts[server].capabilities, if you've defined it
-- print('configuring server:', server)
-- config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
-- require("lspconfig")[server].setup(config)
-- end
-- end
--
-- example calling setup directly for each LSP
-- config = function()
-- local capabilities = require('blink.cmp').get_lsp_capabilities()
-- local lspconfig = require('lspconfig')
--
-- lspconfig['lua_ls'].setup({ capabilities = capabilities })
-- end
-- },
}

View file

@ -0,0 +1,134 @@
function ColorMyPencils(color)
-- color = color or "rose-pine"
color = color or "tokyonight-storm" or "rose-pine" or "tokyonight-night"
vim.cmd.colorscheme(color)
-- vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
-- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
-- Shift+k, supposedly
-- we don't need er
-- vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
-- vim.lsp.handlers.hover, {
-- border = "single", -- Use a sharp border with `FloatBorder` highlights
-- max_width = 50,
-- }
-- )
end
return {
{
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
},
{
"folke/tokyonight.nvim",
priority = 1000,
config = function()
require("tokyonight").setup({
-- your configuration comes here
-- or leave it empty to use the default settings
style = "storm", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day`
transparent = true, -- Enable this to disable setting the background color
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
styles = {
-- Style to be applied to different syntax groups
-- Value is any valid attr-list value for `:help nvim_set_hl`
comments = { italic = false },
keywords = { italic = false },
-- Background styles. Can be "dark", "transparent" or "normal"
sidebars = "dark", -- style for sidebars, see below
floats = "dark", -- style for floating windows
},
})
end,
},
{
"rose-pine/neovim",
name = "rose-pine",
priority = 1000,
config = function()
--[[ require('rose-pine').setup({
disable_background = true,
styles = {
italic = false,
},
}) ]]
require("rose-pine").setup({
variant = "auto", -- auto, main, moon, or dawn
dark_variant = "main", -- main, moon, or dawn
dim_inactive_windows = false,
extend_background_behind_borders = true,
enable = {
terminal = true,
legacy_highlights = true, -- Improve compatibility for previous versions of Neovim
migrations = true, -- Handle deprecated options automatically
},
styles = {
bold = true,
italic = false,
transparency = false,
},
groups = {
border = "muted",
link = "iris",
panel = "surface",
error = "love",
hint = "iris",
info = "foam",
note = "pine",
todo = "rose",
warn = "gold",
git_add = "foam",
git_change = "rose",
git_delete = "love",
git_dirty = "rose",
git_ignore = "muted",
git_merge = "iris",
git_rename = "pine",
git_stage = "iris",
git_text = "rose",
git_untracked = "subtle",
h1 = "iris",
h2 = "foam",
h3 = "rose",
h4 = "gold",
h5 = "pine",
h6 = "foam",
},
highlight_groups = {
-- Comment = { fg = "foam" },
-- VertSplit = { fg = "muted", bg = "muted" },
},
before_highlight = function(group, highlight, palette)
-- Disable all undercurls
-- if highlight.undercurl then
-- highlight.undercurl = false
-- end
--
-- Change palette colour
-- if highlight.fg == palette.pine then
-- highlight.fg = palette.foam
-- end
end,
})
-- vim.cmd("colorscheme rose-pine")
-- vim.cmd("colorscheme rose-pine-main")
-- vim.cmd("colorscheme rose-pine-moon")
-- vim.cmd("colorscheme rose-pine-dawn")
ColorMyPencils()
end,
},
}

View file

@ -0,0 +1,6 @@
return {
"VonHeikemen/fine-cmdline.nvim",
dependencies = {
"MunifTanjim/nui.nvim",
},
}

View file

@ -0,0 +1,6 @@
return {
'numToStr/Comment.nvim',
config = function()
require('Comment').setup()
end
}

View file

@ -0,0 +1,215 @@
return
{
{
"mfussenegger/nvim-dap",
dependencies = {
"rcarriga/nvim-dap-ui",
"theHamsta/nvim-dap-virtual-text",
"nvim-neotest/nvim-nio",
"mfussenegger/nvim-dap-python",
"abayomi185/nvim-dap-probe-rs",
},
config = function()
local dap = require("dap")
local ui = require("dapui")
require("dapui").setup()
require("nvim-dap-virtual-text").setup({})
require('dap-probe-rs').setup()
-- Adapters
dap.adapters.cppdbg = {
id = "cppdbg",
type = "executable",
command = "/home/thegeneralist/.cpptools/extension/debugAdapters/bin/OpenDebugAD7",
}
dap.adapters.gdb = {
type = "executable",
id = "gdb",
args = { "--interpreter=dap", "--eval-command", "set print pretty on" }
}
dap.adapters["probe-rs-debug"] = {
type = "server",
port = "${port}",
executable = {
command = vim.fn.expand "$HOME/.cargo/bin/probe-rs",
args = { "dap-server", "--port", "${port}" },
},
}
-- RUST
dap.adapters["probe-rs-debug"] = {
type = "server",
port = "${port}",
executable = {
command = vim.fn.expand "$HOME/.cargo/bin/probe-rs",
args = { "dap-server", "--port", "${port}" },
},
}
-- Connect the probe-rs-debug with rust files. Configuration of the debugger is done via project_folder/.vscode/launch.json
require("dap.ext.vscode").type_to_filetypes["probe-rs-debug"] = { "rust" }
-- Set up of handlers for RTT and probe-rs messages.
-- In addition to nvim-dap-ui I write messages to a probe-rs.log in project folder
-- If RTT is enabled, probe-rs sends an event after init of a channel. This has to be confirmed or otherwise probe-rs wont sent the rtt data.
dap.listeners.before["event_probe-rs-rtt-channel-config"]["plugins.nvim-dap-probe-rs"] = function(session, body)
local utils = require "dap.utils"
utils.notify(
string.format('probe-rs: Opening RTT channel %d with name "%s"!', body.channelNumber, body.channelName)
)
local file = io.open("probe-rs.log", "a")
if file then
file:write(
string.format(
'%s: Opening RTT channel %d with name "%s"!\n',
os.date "%Y-%m-%d-T%H:%M:%S",
body.channelNumber,
body.channelName
)
)
end
if file then file:close() end
session:request("rttWindowOpened", { body.channelNumber, true })
end
-- After confirming RTT window is open, we will get rtt-data-events.
-- I print them to the dap-repl, which is one way and not separated.
-- If you have better ideas, let me know.
dap.listeners.before["event_probe-rs-rtt-data"]["plugins.nvim-dap-probe-rs"] = function(_, body)
local message =
string.format("%s: RTT-Channel %d - Message: %s", os.date "%Y-%m-%d-T%H:%M:%S", body.channelNumber, body
.data)
local repl = require "dap.repl"
repl.append(message)
local file = io.open("probe-rs.log", "a")
if file then file:write(message) end
if file then file:close() end
end
-- Probe-rs can send messages, which are handled with this listener.
dap.listeners.before["event_probe-rs-show-message"]["plugins.nvim-dap-probe-rs"] = function(_, body)
local message = string.format("%s: probe-rs message: %s", os.date "%Y-%m-%d-T%H:%M:%S", body.message)
local repl = require "dap.repl"
repl.append(message)
local file = io.open("probe-rs.log", "a")
if file then file:write(message) end
if file then file:close() end
end
-- RUST END
dap.configurations.c = {
{
name = "Launch",
type = "gdb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = "${workspaceFolder}",
stopAtBeginningOfMainSubprogram = false,
},
{
name = "Select and attach to process",
type = "gdb",
request = "attach",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
pid = function()
local name = vim.fn.input('Executable name (filter): ')
return require("dap.utils").pick_process({ filter = name })
end,
cwd = '${workspaceFolder}'
},
{
name = 'Attach to gdbserver :1234',
type = 'gdb',
request = 'attach',
target = 'localhost:1234',
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = '${workspaceFolder}'
},
}
-- Configurations
-- dap.configurations.cpp = {
-- {
-- name = "Launch file",
-- type = "cppdbg",
-- request = "launch",
-- program = function()
-- return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
-- end,
-- cwd = "${workspaceFolder}",
-- stopAtEntry = true,
-- setupCommands = {
-- {
-- text = "-enable-pretty-printing",
-- description = "enable pretty printing",
-- ignoreFailures = false,
-- },
-- },
-- },
-- {
-- name = "Attach to gdbserver :1234",
-- type = "cppdbg",
-- request = "launch",
-- MIMode = "gdb",
-- miDebuggerServerAddress = "localhost:1234",
-- miDebuggerPath = "/usr/bin/gdb",
-- cwd = "${workspaceFolder}",
-- program = function()
-- return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
-- end,
-- setupCommands = {
-- {
-- text = "-enable-pretty-printing",
-- description = "enable pretty printing",
-- ignoreFailures = false,
-- },
-- },
-- },
-- }
dap.configurations.cpp = dap.configurations.c
require("dap-python").setup("python")
vim.keymap.set("n", "<leader>b", dap.toggle_breakpoint)
vim.keymap.set("n", "<leader>gb", dap.run_to_cursor)
vim.keymap.set("n", "<leader>guo", ui.open)
vim.keymap.set("n", "<leader>guc", ui.close)
-- Eval var under cursor
vim.keymap.set("n", "<leader>?", function()
ui.eval(nil, { enter = true })
end)
vim.keymap.set("n", "<F1>", dap.continue)
vim.keymap.set("n", "<F2>", dap.step_into)
vim.keymap.set("n", "<F3>", dap.step_over)
vim.keymap.set("n", "<F4>", dap.step_out)
vim.keymap.set("n", "<F5>", dap.step_back)
vim.keymap.set("n", "<F6>", dap.restart)
dap.listeners.before.attach.dapui_config = function()
ui.open()
end
dap.listeners.before.launch.dapui_config = function()
ui.open()
end
-- dap.listeners.before.event_terminated.dapui_config = function()
-- ui.close()
-- end
-- dap.listeners.before.event_exited.dapui_config = function()
-- -- ui.close()
-- end
end,
},
{
'mrcjkb/rustaceanvim',
version = '^5', -- Recommended
lazy = false, -- This plugin is already lazy
}
}

View file

@ -0,0 +1,6 @@
return {
"tpope/vim-fugitive",
config = function()
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
end
}

View file

@ -0,0 +1,52 @@
return {
'ldelossa/gh.nvim',
dependencies = {
"ldelossa/litee.nvim"
},
config = function()
require('litee.lib').setup()
require('litee.gh').setup({
-- deprecated, around for compatability for now.
jump_mode = "invoking",
-- remap the arrow keys to resize any litee.nvim windows.
map_resize_keys = false,
-- do not map any keys inside any gh.nvim buffers.
disable_keymaps = false,
-- the icon set to use.
icon_set = "default",
-- any custom icons to use.
icon_set_custom = nil,
-- whether to register the @username and #issue_number omnifunc completion
-- in buffers which start with .git/
git_buffer_completion = true,
-- defines keymaps in gh.nvim buffers.
keymaps = {
-- when inside a gh.nvim panel, this key will open a node if it has
-- any futher functionality. for example, hitting <CR> on a commit node
-- will open the commit's changed files in a new gh.nvim panel.
open = "<CR>",
-- when inside a gh.nvim panel, expand a collapsed node
expand = "zo",
-- when inside a gh.nvim panel, collpased and expanded node
collapse = "zc",
-- when cursor is over a "#1234" formatted issue or PR, open its details
-- and comments in a new tab.
goto_issue = "gd",
-- show any details about a node, typically, this reveals commit messages
-- and submitted review bodys.
details = "d",
-- inside a convo buffer, submit a comment
submit_comment = "<C-s>",
-- inside a convo buffer, when your cursor is ontop of a comment, open
-- up a set of actions that can be performed.
actions = "<C-a>",
-- inside a thread convo buffer, resolve the thread.
resolve_thread = "<C-r>",
-- inside a gh.nvim panel, if possible, open the node's web URL in your
-- browser. useful particularily for digging into external failed CI
-- checks.
goto_web = "gx"
}
})
end
}

View file

@ -0,0 +1,54 @@
return {
"theprimeagen/harpoon",
branch = "harpoon2",
config = function()
local harpoon = require("harpoon")
harpoon:setup()
-- Add and list
vim.keymap.set(
"n",
"<leader>a",
function() harpoon:list():add() end,
{ desc = '[Harpoon] Add file' }
)
vim.keymap.set(
"n",
"<C-e>",
function() harpoon.ui:toggle_quick_menu(harpoon:list()) end,
{ desc = '[Harpoon] Toggle quick menu' }
)
-- Navigate
vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end, { desc = '[Harpoon] First file' })
vim.keymap.set("n", "<C-j>", function() harpoon:list():select(2) end, { desc = '[Harpoon] Second file' })
vim.keymap.set("n", "<C-k>", function() harpoon:list():select(3) end, { desc = '[Harpoon] Third file' })
vim.keymap.set("n", "<C-l>", function() harpoon:list():select(4) end, { desc = '[Harpoon] Fourth file' })
vim.keymap.set("n", "<C-]>", function()
local input = vim.fn.input("File number > ")
local file_number = tonumber(input, 10)
if not file_number then return print(input .. " is not a valid number") end
harpoon:list():select(file_number)
end, { desc = '[Harpoon] File by number' })
-- Set
vim.keymap.set("n", "<leader><C-h>", function() harpoon:list():replace_at(1) end,
{ desc = '[Harpoon] Replace first file' })
vim.keymap.set("n", "<leader><C-j>", function() harpoon:list():replace_at(2) end,
{ desc = '[Harpoon] Replace second file' })
vim.keymap.set("n", "<leader><C-k>", function() harpoon:list():replace_at(3) end,
{ desc = '[Harpoon] Replace third file' })
vim.keymap.set("n", "<leader><C-l>", function() harpoon:list():replace_at(4) end,
{ desc = '[Harpoon] Replace fourth file' })
vim.keymap.set("n",
"<leader><C-]>",
function()
local file_number = tonumber(vim.fn.input("File number > "), 10)
if not file_number then return end
harpoon:list():select(file_number)
end,
{ desc = '[Harpoon] File by number' }
)
end
}

View file

@ -0,0 +1,101 @@
return {
{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
---@module "ibl"
---@type ibl.config
opts = {},
},
--[[ {
'boganworld/crackboard.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
opts = {
session_key = 'redacted',
},
}, ]]
{
"onsails/lspkind-nvim",
},
-- {
-- "ziglang/zig.vim",
-- },
{
"nvim-lua/plenary.nvim",
name = "plenary",
},
{
"stevearc/oil.nvim",
config = function()
require("oil").setup()
end,
},
-- {
-- -- https://github.com/zbirenbaum/copilot.lua
-- "zbirenbaum/copilot.lua",
-- cmd = "Copilot",
-- event = "InsertEnter",
-- config = function()
-- require("copilot").setup({
-- panel = {
-- keymap = {
-- jump_prev = "]]",
-- jump_next = "[[",
-- accept = "<Tab>",
-- refresh = "gr",
-- open = "<M-]>",
-- },
-- },
-- suggestion = {
-- auto_trigger = true,
-- keymap = {
-- accept = "<M-Tab>",
-- },
-- },
-- })
-- -- vim.keymap.set("n", "<leader>cpe", "<cmd>Copilot enable<CR>")
-- -- vim.keymap.set("n", "<leader>cpd", "<cmd>Copilot disable<CR>")
-- end,
-- },
{
"github/copilot.vim",
config = function()
-- set <leader>cpd and <leader>cpe to disable/enable copilot
vim.keymap.set("n", "<leader>cpe", "<cmd>Copilot enable<CR>")
vim.keymap.set("n", "<leader>cpd", "<cmd>Copilot disable<CR>")
end,
},
-- {
-- "Exafunction/codeium.nvim",
-- dependencies = {
-- "nvim-lua/plenary.nvim",
-- "hrsh7th/nvim-cmp",
-- },
-- config = function()
-- require("codeium").setup({
-- -- https://github.com/Exafunction/codeium.vim
-- })
-- end
-- },
{
"ldelossa/gh.nvim",
dependencies = {
"ldelossa/litee.nvim",
},
},
"eandrju/cellular-automaton.nvim",
"gpanders/editorconfig.nvim",
-- Useful for getting pretty icons, but requires a Nerd Font.
{ "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font },
"lambdalisue/nerdfont.vim",
"junegunn/vim-easy-align",
"rcarriga/nvim-notify",
-- Highlight todo, notes, etc in comments
{
"folke/todo-comments.nvim",
event = "VimEnter",
dependencies = { "nvim-lua/plenary.nvim" },
opts = { signs = false },
},
}

View file

@ -0,0 +1,41 @@
return {
-- "SUSTech-data/neopyter",
-- ---@type neopyter.Option
-- opts = {
-- mode = "proxy", -- was "direct"
-- remote_address = "127.0.0.1:9001",
-- file_pattern = { "*.ju.*" },
-- on_attach = function(bufnr)
-- -- do some buffer keymap
-- end,
-- highlight = {
-- enable = true,
-- shortsighted = false,
-- },
-- parser = {
-- -- trim leading/tailing whitespace of cell
-- trim_whitespace = false,
-- },
-- },
-- on_attach = function(buf)
-- local function map(mode, lhs, rhs, desc)
-- vim.keymap.set(mode, lhs, rhs, { desc = desc, buffer = buf })
-- end
-- -- same, recommend the former
-- map("n", "<C-Enter>", "<cmd>Neopyter execute notebook:run-cell<cr>", "run selected")
-- -- map("n", "<C-Enter>", "<cmd>Neopyter run current<cr>", "run selected")
--
-- -- same, recommend the former
-- map("n", "<space>X", "<cmd>Neopyter execute notebook:run-all-above<cr>", "run all above cell")
-- -- map("n", "<space>X", "<cmd>Neopyter run allAbove<cr>", "run all above cell")
--
-- -- same, recommend the former, but the latter is silent
-- map("n", "<space>nt", "<cmd>Neopyter execute kernelmenu:restart<cr>", "restart kernel")
-- -- map("n", "<space>nt", "<cmd>Neopyter kernel restart<cr>", "restart kernel")
--
-- map("n", "<S-Enter>", "<cmd>Neopyter execute runmenu:run<cr>", "run selected and select next")
-- map("n", "<M-Enter>", "<cmd>Neopyter execute run-cell-and-insert-below<cr>", "run selected and insert below")
--
-- map("n", "<F5>", "<cmd>Neopyter execute notebook:restart-run-all<cr>", "restart kernel and run all")
-- end,
}

View file

@ -0,0 +1,25 @@
return {
{
"folke/lazydev.nvim",
ft = "lua", -- only load on lua files
opts = {
library = {
-- See the configuration section for more details
-- Load luvit types when the `vim.uv` word is found
{ path = "luvit-meta/library", words = { "vim%.uv" } },
},
},
},
{ "Bilal2453/luvit-meta", lazy = true }, -- optional `vim.uv` typings
{ -- optional completion source for require statements and module annotations
"hrsh7th/nvim-cmp",
opts = function(_, opts)
opts.sources = opts.sources or {}
table.insert(opts.sources, {
name = "lazydev",
group_index = 0, -- set group index to 0 to skip loading LuaLS completions
})
end,
},
-- { "folke/neodev.nvim", enabled = false }, -- make sure to uninstall or disable neodev.nvim
}

View file

@ -0,0 +1,287 @@
return {
{
"neovim/nvim-lspconfig",
dependencies = {
"saghen/blink.cmp",
-- "folke/neodev.nvim",
"williamboman/mason.nvim",
"mason-org/mason-registry",
"williamboman/mason-lspconfig.nvim",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
-- "hrsh7th/nvim-cmp",
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
"j-hui/fidget.nvim",
},
config = function()
local lspkind = require("lspkind")
-- local cmp = require("cmp")
-- local cmp_lsp = require("cmp_nvim_lsp")
-- local capabilities = vim.tbl_deep_extend(
-- "force",
-- {},
-- vim.lsp.protocol.make_client_capabilities(),
-- cmp_lsp.default_capabilities()
-- )
require("fidget").setup({})
require("mason").setup()
local capabilities = require("blink.cmp").get_lsp_capabilities()
require("lspconfig").lua_ls.setup({ capabilites = capabilities })
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local c = vim.lsp.get_client_by_id(args.data.client_id)
if not c then
return
end
if vim.bo.filetype == "lua" then
-- Format the current buffer on save
vim.api.nvim_create_autocmd("BufWritePre", {
buffer = args.buf,
callback = function()
vim.lsp.buf.format({ bufnr = args.buf, id = c.id })
end,
})
end
end,
})
-- local vue_typescript_plugin = require("mason-registry")
-- .get_package("vue-language-server")
-- :get_install_path() .. "/node_modules/@vue/language-server" .. "/node_modules/@vue/typescript-plugin"
-- require("mason-lspconfig").setup({
-- ensure_installed = {
-- "lua_ls",
-- "rust_analyzer",
-- "ts_ls",
-- "cssls",
-- "tailwindcss",
-- "pyright",
-- },
-- handlers = {
-- function(server_name) -- default handler (optional)
-- if server_name == "rust_analyzer" then
-- return
-- end
-- require("lspconfig")[server_name].setup({
-- capabilities = capabilities,
-- })
-- end,
--
-- ["lua_ls"] = function()
-- local lspconfig = require("lspconfig")
-- lspconfig.lua_ls.setup({
-- capabilities = capabilities,
-- settings = {
-- Lua = {
-- diagnostics = {
-- globals = { "vim", "it", "describe", "before_each", "after_each" },
-- },
-- },
-- },
-- })
-- end,
--
-- ["ts_ls"] = function()
-- local lspconfig = require("lspconfig")
-- lspconfig.ts_ls.setup({
-- capabilities = capabilities,
-- -- settings = {
-- -- },
-- init_options = {
-- plugins = {
-- {
-- name = "@vue/typescript-plugin",
-- location = vue_typescript_plugin,
-- languages = { "vue" },
-- },
-- },
-- },
-- filetypes = {
-- "javascript",
-- "javascriptreact",
-- "javascript.jsx",
-- "typescript",
-- "typescriptreact",
-- "typescript.tsx",
-- "vue",
-- },
-- })
-- end,
-- },
-- })
-- local cmp_select = { behavior = cmp.SelectBehavior.Select }
--- Select item next/prev, taking into account whether the cmp window is
--- top-down or bottoom-up so that the movement is always in the same direction.
-- local select_item_smart = function(dir, opts)
-- return function(fallback)
-- if cmp.visible() then
-- opts = opts or { behavior = cmp.SelectBehavior.Select }
-- if cmp.core.view.custom_entries_view:is_direction_top_down() then
-- ({ next = cmp.select_next_item, prev = cmp.select_prev_item })[dir](opts)
-- else
-- ({ prev = cmp.select_next_item, next = cmp.select_prev_item })[dir](opts)
-- end
-- else
-- fallback()
-- end
-- end
-- end
-- cmp.setup({
-- snippet = {
-- expand = function(args)
-- require("luasnip").lsp_expand(args.body) -- For `luasnip` users.
-- end,
-- },
-- completion = {
-- completeopt = "menu,menuone,noinsert",
-- },
-- -- No idea what this is
-- matching = {
-- disallow_fuzzy_matching = false,
-- disallow_fullfuzzy_matching = false,
-- disallow_partial_fuzzy_matching = false,
-- },
-- performance = {
-- -- debounce = 50,
-- debounce = 25,
-- -- max_view_entries = 20,
-- },
-- That crazy window
-- window = {
-- completion = cmp.config.window.bordered({
-- border = "single",
-- side_padding = 2,
-- col_offset = -3,
-- max_width = 80,
-- }),
-- documentation = cmp.config.window.bordered({
-- max_width = 50,
-- }),
-- },
-- mapping = cmp.mapping.preset.insert({
-- ["<C-p>"] = select_item_smart("prev", cmp_select),
-- ["<C-n>"] = select_item_smart("next", cmp_select),
-- ["<C-e>"] = cmp.mapping.close(),
-- ["<C-y>"] = cmp.mapping.confirm({ select = true }),
-- ["<Tab>"] = cmp.mapping.confirm({ select = true }),
-- ["<C-B>"] = cmp.mapping.complete(),
-- ["<C-u>"] = cmp.mapping.scroll_docs(-3),
-- ["<C-d>"] = cmp.mapping.scroll_docs(3),
-- ["<C-g>"] = cmp.mapping.abort(),
-- }),
-- sorting = {
-- comparators = {
-- cmp.config.compare.locality,
-- cmp.config.compare.offset,
-- cmp.config.compare.recently_used,
-- cmp.config.compare.exact,
-- cmp.config.compare.order,
-- cmp.config.compare.length,
-- function(entry1, entry2)
-- local _, entry1_under = entry1.completion_item.label:find("^_+")
-- local _, entry2_under = entry2.completion_item.label:find("^_+")
-- entry1_under = entry1_under or 0
-- entry2_under = entry2_under or 0
-- if entry1_under > entry2_under then
-- return false
-- elseif entry1_under < entry2_under then
-- return true
-- end
-- end,
-- cmp.config.compare.kind,
-- cmp.config.compare.sort_text,
-- },
-- },
-- sources = cmp.config.sources({
-- { name = "neopyter" },
-- { name = "nvim_lsp" },
-- { name = "codeium" },
-- { name = "luasnip" }, -- For luasnip users.
-- }, {
-- { name = "buffer" },
-- }),
-- formatting = {
-- fields = {
-- "abbr",
-- "kind",
-- "menu",
-- },
-- expandable_indicator = true,
-- format = lspkind.cmp_format({
-- mode = "symbol_text",
-- maxwidth = 50,
-- ellipsis_char = "...",
-- menu = {
-- neopyter = "[Neopyter]",
-- },
-- symbol_map = {
-- -- specific complete item kind icon
-- ["Magic"] = "🪄",
-- ["Path"] = "📁",
-- ["Dict key"] = "🔑",
-- ["Instance"] = "󱃻",
-- ["Statement"] = "󱇯",
-- },
-- }),
-- },
-- })
-- -- menu item highlight
-- vim.api.nvim_set_hl(0, "CmpItemKindMagic", { bg = "NONE", fg = "#D4D434" })
-- vim.api.nvim_set_hl(0, "CmpItemKindPath", { link = "CmpItemKindFolder" })
-- vim.api.nvim_set_hl(0, "CmpItemKindDictkey", { link = "CmpItemKindKeyword" })
-- vim.api.nvim_set_hl(0, "CmpItemKindInstance", { link = "CmpItemKindVariable" })
-- vim.api.nvim_set_hl(0, "CmpItemKindStatement", { link = "CmpItemKindVariable" })
-- vim.diagnostic.config({
-- -- update_in_insert = true, -- Update diagnostics in Insert mode
-- -- ^ (if false, diagnostics are updated on InsertLeave)
--
-- underline = true,
--
-- virtual_text = true,
--
-- severity_sort = true, -- high -> low
--
-- -- float = {
-- -- focusable = false,
-- -- style = "minimal",
-- -- border = "rounded",
-- -- source = true,
-- -- header = { "  Diagnostics", "String" },
-- -- prefix = function(_, _, _)
-- -- return "  ", "String"
-- -- end,
-- -- },
-- })
-- treesitter jupyter notebook stuff
-- require("nvim-treesitter.configs").setup({
-- textobjects = {
-- move = {
-- enable = true,
-- goto_next_start = {
-- ["]j"] = "@cellseparator",
-- ["]c"] = "@cellcontent",
-- },
-- goto_previous_start = {
-- ["[j"] = "@cellseparator",
-- ["[c"] = "@cellcontent",
-- },
-- },
-- },
-- })
end,
},
}

View file

@ -0,0 +1,22 @@
return {
"L3MON4D3/LuaSnip",
-- follow latest release.
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
-- install jsregexp (optional!).
build = "make install_jsregexp",
dependencies = { "rafamadriz/friendly-snippets" },
config = function()
local ls = require("luasnip")
require("luasnip.loaders.from_vscode").lazy_load()
vim.keymap.set({ "i" }, "<C-K>", function() ls.expand() end, { silent = true })
vim.keymap.set({ "i", "s" }, "<C-L>", function() ls.jump(1) end, { silent = true })
vim.keymap.set({ "i", "s" }, "<C-J>", function() ls.jump(-1) end, { silent = true })
vim.keymap.set({ "i", "s" }, "<C-E>", function()
if ls.choice_active() then
ls.change_choice(1)
end
end, { silent = true })
end
}

View file

@ -0,0 +1,9 @@
return {
-- "iamcco/markdown-preview.nvim",
-- cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
-- build = "cd app && yarn install",
-- init = function()
-- vim.g.mkdp_filetypes = { "markdown" }
-- end,
-- ft = { "markdown" },
}

View file

@ -0,0 +1,25 @@
return {
"danymat/neogen",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"L3MON4D3/LuaSnip",
},
config = function()
local neogen = require("neogen")
neogen.setup({
snippet_engine = "luasnip"
})
vim.keymap.set("n", "<leader>nf", function()
neogen.generate({ type = "func" })
end)
vim.keymap.set("n", "<leader>nt", function()
neogen.generate({ type = "type" })
end)
end
-- Uncomment next line if you want to follow only stable versions
-- version = "*"
}

View file

@ -0,0 +1,51 @@
--[[
These three tabs are necessary when dealing with this nonsense:
- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTIN_CONFIG.md#arguments
- https://github.com/jay-babu/mason-null-ls.nvim
- https://github.com/nvimtools/none-ls.nvim
--]]
return {
"jay-babu/mason-null-ls.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"williamboman/mason.nvim",
"nvimtools/none-ls.nvim",
"nvimtools/none-ls-extras.nvim",
},
config = function()
local null_ls = require("null-ls")
require("mason-null-ls").setup({
ensure_installed = {
"stylua",
"jq",
"mypy",
"ruff",
"black",
},
handlers = {
["mypy"] = function(source_name, methods)
local options = {
extra_args = function()
local command = "which python"
local handle = io.popen(command)
local python_path = ""
if handle then
python_path = handle:read("*a")
python_path = string.gsub(python_path, "\n", "")
handle:close()
end
return { "--python-executable", python_path }
end,
}
null_ls.register(null_ls.builtins.diagnostics.mypy.with(options))
end,
--[[ ["ruff"] = function(source_name, methods)
null_ls.register(null_ls.builtins.diagnostics.ruff)
--require('mason-null-ls').default_setup(source_name, methods) -- to maintain default behavior
end, ]]
},
})
null_ls.setup()
end,
}

View file

@ -0,0 +1,128 @@
return {
"nvim-lualine/lualine.nvim",
-- "freddiehaddad/feline.nvim",
dependencies = {
-- "Hitesh-Aggarwal/feline_one_monokai.nvim",
"nvim-tree/nvim-web-devicons",
},
config = function()
local tcolors = require("tokyonight.colors").setup() -- pass in any of the config options as explained above
local util = require("tokyonight.util")
local bgc = util.lighten(tcolors.bg_statusline, 0.9)
local theme = {
normal = {
a = { fg = tcolors.fg, bg = bgc },
b = { fg = tcolors.fg, bg = bgc },
c = { fg = tcolors.fg, bg = bgc },
z = { fg = tcolors.fg, bg = bgc },
},
insert = { a = { fg = tcolors.black, bg = tcolors.green } },
visual = { a = { fg = tcolors.black, bg = tcolors.orange } },
replace = { a = { fg = tcolors.black, bg = tcolors.green } },
}
local empty = require("lualine.component"):extend()
function empty:draw(default_highlight)
self.status = ""
self.applied_separator = ""
self:apply_highlights(default_highlight)
self:apply_section_separators()
return self.status
end
-- Put proper separators and gaps between components in sections
local function process_sections(sections)
for name, section in pairs(sections) do
local left = name:sub(9, 10) < "x"
for pos = 1, name ~= "lualine_z" and #section or #section - 1 do
table.insert(section, pos * 2, { empty, color = { fg = tcolors.bg_dark, bg = tcolors.bg_dark } })
end
for id, comp in ipairs(section) do
if type(comp) ~= "table" then
comp = { comp }
section[id] = comp
end
comp.separator = left and { right = "" } or { left = "" }
end
end
return sections
end
local function search_result()
if vim.v.hlsearch == 0 then
return ""
end
local last_search = vim.fn.getreg("/")
if not last_search or last_search == "" then
return ""
end
local searchcount = vim.fn.searchcount({ maxcount = 9999 })
return last_search .. "(" .. searchcount.current .. "/" .. searchcount.total .. ")"
end
local function modified()
if vim.bo.modified then
return "+"
elseif vim.bo.modifiable == false or vim.bo.readonly == true then
return "-"
end
return ""
end
require("lualine").setup({
options = {
theme = theme,
component_separators = "",
section_separators = { left = "", right = "" },
},
sections = process_sections({
lualine_a = { "mode" },
lualine_b = {
"branch",
-- "diff",
{
"diagnostics",
source = { "nvim" },
sections = { "error" },
diagnostics_color = { error = { bg = tcolors.red1, fg = tcolors.bg } },
},
{
"diagnostics",
source = { "nvim" },
sections = { "warn" },
diagnostics_color = { warn = { bg = tcolors.orange, fg = tcolors.bg } },
},
{ "filename", file_status = false, path = 3 },
{ modified, color = { bg = tcolors.red1, fg = "#ffffff" } },
{
"%w",
cond = function()
return vim.wo.previewwindow
end,
},
{
"%r",
cond = function()
return vim.bo.readonly
end,
},
{
"%q",
cond = function()
return vim.bo.buftype == "quickfix"
end,
},
},
lualine_c = {},
lualine_x = {},
lualine_y = { search_result, "filetype" },
lualine_z = { "%l:%c", "%p%%/%L" },
}),
inactive_sections = {
lualine_c = { "%f %y %m" },
lualine_x = {},
},
})
end,
}

View file

@ -0,0 +1,63 @@
return {
"nvim-telescope/telescope.nvim",
tag = "0.1.5",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
require("telescope").setup({
defaults = {
preview = {
treesitter = true,
},
file_ignore_patterns = {
"node_modules",
},
},
})
local builtin = require("telescope.builtin")
pcall(require("telescope").load_extension, "fzf")
vim.keymap.set("n", "<leader>ps", function()
local search_string = vim.fn.input("Grep > ")
if search_string == "" then
return
end
builtin.grep_string({ search = search_string })
end)
vim.keymap.set("n", "<leader>pws", function()
local word = vim.fn.expand("<cword>")
builtin.grep_string({ search = word })
end)
vim.keymap.set("n", "<leader>pWs", function()
local word = vim.fn.expand("<cWORD>")
builtin.grep_string({ search = word })
end)
vim.keymap.set("n", "<leader>pg", builtin.live_grep, {})
vim.keymap.set("n", "<leader>pf", builtin.find_files, {})
vim.keymap.set("n", "<C-p>", builtin.git_files, {})
vim.keymap.set("n", "<leader>pb", builtin.buffers, {})
-- Slightly advanced example of overriding default behavior and theme
vim.keymap.set("n", "<leader>/", function()
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
winblend = 10,
previewer = false,
}))
end, { desc = "[/] Fuzzily search in current buffer" })
-- Shortcut for searching your Neovim configuration files
vim.keymap.set("n", "<leader>on", function()
builtin.find_files({ cwd = vim.fn.stdpath("config") })
end, { desc = "[O]pen [N]eovim files" })
end,
}

View file

@ -0,0 +1,45 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
require('nvim-treesitter.configs').setup({
ensure_installed = {
},
-- A list of parser names, or "all" (the five listed parsers should always be installed)
--[[
ensure_installed = {
"svelte",
"javascript",
"typescript",
"c",
"cpp",
"html",
"css",
"scss",
"lua",
"vim",
"vimdoc",
"query"
},
--]]
--ensure_installed = 'all',
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
highlight = {
enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
})
end
}

View file

@ -0,0 +1,23 @@
return {
{
"folke/trouble.nvim",
config = function()
require("trouble").setup({
icons = false,
})
vim.keymap.set("n", "<leader>tt", function()
require("trouble").toggle()
end)
vim.keymap.set("n", "[t", function()
require("trouble").next({skip_groups = true, jump = true});
end)
vim.keymap.set("n", "]t", function()
require("trouble").previous({skip_groups = true, jump = true});
end)
end
},
}

View file

@ -0,0 +1,7 @@
return {
"mbbill/undotree",
config = function()
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
end,
}

View file

@ -0,0 +1,73 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
commit = "af4ded85542d40e190014c732fa051bdbf88be3d",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
opts = {
t = {
name = '+Trouble',
w = { '<cmd>TroubleToggle workspace_diagnostics<cr>', 'Workspace Diagnostics' },
d = { '<cmd>TroubleToggle document_diagnostics<cr>', 'Document Diagnostics' },
q = { '<cmd>TroubleToggle quickfix<cr>', 'Quickfix' },
l = { '<cmd>TroubleToggle loclist<cr>', 'Location List' },
},
g = {
R = { '<cmd>TroubleToggle lsp_references<cr>', 'LSP References' },
h = {
name = "+Git",
h = {
name = "+Github",
c = {
name = "+Commits",
c = { "<cmd>GHCloseCommit<cr>", "Close" },
e = { "<cmd>GHExpandCommit<cr>", "Expand" },
o = { "<cmd>GHOpenToCommit<cr>", "Open To" },
p = { "<cmd>GHPopOutCommit<cr>", "Pop Out" },
z = { "<cmd>GHCollapseCommit<cr>", "Collapse" },
},
i = {
name = "+Issues",
p = { "<cmd>GHPreviewIssue<cr>", "Preview" },
},
l = {
name = "+Litee",
t = { "<cmd>LTPanel<cr>", "Toggle Panel" },
},
r = {
name = "+Review",
b = { "<cmd>GHStartReview<cr>", "Begin" },
c = { "<cmd>GHCloseReview<cr>", "Close" },
d = { "<cmd>GHDeleteReview<cr>", "Delete" },
e = { "<cmd>GHExpandReview<cr>", "Expand" },
s = { "<cmd>GHSubmitReview<cr>", "Submit" },
z = { "<cmd>GHCollapseReview<cr>", "Collapse" },
},
p = {
name = "+Pull Request",
c = { "<cmd>GHClosePR<cr>", "Close" },
d = { "<cmd>GHPRDetails<cr>", "Details" },
e = { "<cmd>GHExpandPR<cr>", "Expand" },
o = { "<cmd>GHOpenPR<cr>", "Open" },
p = { "<cmd>GHPopOutPR<cr>", "PopOut" },
r = { "<cmd>GHRefreshPR<cr>", "Refresh" },
t = { "<cmd>GHOpenToPR<cr>", "Open To" },
z = { "<cmd>GHCollapsePR<cr>", "Collapse" },
},
t = {
name = "+Threads",
c = { "<cmd>GHCreateThread<cr>", "Create" },
n = { "<cmd>GHNextThread<cr>", "Next" },
t = { "<cmd>GHToggleThread<cr>", "Toggle" },
},
},
},
},
--conf end
}
}
--local wk = require("which-key")
--wk.register({
--}, { prefix = "<leader>" })

View file

@ -0,0 +1,17 @@
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)
require("lazy").setup({
spec = "thegeneralist.lazy",
change_detection = { notify = false }
})

View file

@ -0,0 +1,101 @@
vim.g.mapleader = " "
--vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
--vim.keymap.set("n", "<leader>e", vim.cmd.Ex)
-- vim.keymap.set("n", "<leader>e", function()
-- vim.cmd("NvimTreeToggle")
-- end)
vim.keymap.set("n", "<leader>e", "<CMD>Oil<CR>", { desc = "Open parent directory" })
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
vim.keymap.set("n", "J", "mzJ`z")
vim.keymap.set("n", "<C-d>", "<C-d>zz")
vim.keymap.set("n", "<C-u>", "<C-u>zz")
vim.keymap.set("n", "n", "nzzzv")
vim.keymap.set("n", "N", "Nzzzv")
vim.keymap.set("n", "<leader>vwm", function()
require("vim-with-me").StartVimWithMe()
end)
vim.keymap.set("n", "<leader>svwm", function()
require("vim-with-me").StopVimWithMe()
end)
vim.keymap.set("n", "<leader>vs", "<C-w>v")
-- greatest remap ever
vim.keymap.set("x", "<leader>p", [["_dP]])
-- next greatest remap ever : asbjornHaland
vim.keymap.set({ "n", "v" }, "<leader>y", [["+y]])
vim.keymap.set("n", "<leader>Y", [["+Y]])
vim.keymap.set({ "n", "v" }, "<leader>d", [["_d]])
-- This is going to get me cancelled
vim.keymap.set("i", "<C-c>", "<Esc>")
vim.keymap.set("n", "Q", "<nop>")
vim.keymap.set("n", "<C-f>", "<cmd>silent !tmux neww tmux-sessionizer<CR>")
vim.keymap.set("n", "<leader>f", vim.lsp.buf.format)
vim.keymap.set("n", "<leader>m<C-k>", "<cmd>cnext<CR>zz")
vim.keymap.set("n", "<leader>m<C-j>", "<cmd>cprev<CR>zz")
vim.keymap.set("n", "<leader>mk", "<cmd>lnext<CR>zz")
vim.keymap.set("n", "<leader>mj", "<cmd>lprev<CR>zz")
vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true })
vim.keymap.set("n", "<leader>ge", "oif err != nil {<CR>}<Esc>Oreturn err<Esc>")
vim.keymap.set("n", "<leader>vpp", "<cmd>e ~/.dotfiles/nvim/.config/nvim/lua/theprimeagen/packer.lua<CR>")
vim.keymap.set("n", "<leader>mr", "<cmd>CellularAutomaton make_it_rain<CR>")
vim.keymap.set("n", "<leader><leader>", function()
vim.cmd("so")
end)
vim.keymap.set("n", "zh", "$viBhzf", {
desc = "Fold { block",
})
vim.keymap.set("n", "zj", "$vi[hzf", {
desc = "Fold [ block",
})
vim.keymap.set("n", "zk", "$vibhzf", {
desc = "Fold ( block",
})
vim.keymap.set("n", "ga", "<cmd>EasyAlign<CR>")
vim.keymap.set("v", "ga", "<cmd>'<,'>EasyAlign<CR>")
-- Keep selection in visual mode after indent
vim.keymap.set("v", "<", "<gv")
vim.keymap.set("v", ">", ">gv")
-- Indent with tab
vim.keymap.set("v", "<Tab>", ">gv")
vim.keymap.set("v", "<S-Tab>", "<gv")
-- Close window on the bottom
vim.keymap.set("n", "<C-w>e", "<C-w>j<C-w>q")
vim.keymap.set("n", "<leader>w", function()
vim.ui.input({ prompt = "Enter value for shiftwidth: " }, function(input)
vim.o.shiftwidth = tonumber(input)
end)
end)
-- vim.keymap.set("n", "<leader>tc", function()
-- -- local file_number = tonumber(vim.fn.input("File number > "), 10)
-- vim.fn.inputlist({
-- "Select a theme",
-- "1. onedark",
-- })
-- end)
vim.keymap.set("n", "<leader>lr", "<cmd>LspRestart<CR>", { desc = "Restart LSP" })
vim.keymap.set("n", "<leader>le", "<cmd>LspStart<CR>", { desc = "Start LSP" })
vim.keymap.set("n", "<leader>ld", "<cmd>LspStop<CR>", { desc = "Stop LSP" })

View file

@ -0,0 +1,38 @@
vim.opt.guicursor = "n-v-c-i:block"
vim.opt.nu = true
vim.opt.relativenumber = true
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.wrap = false
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.opt.undofile = true
vim.opt.hlsearch = false
vim.opt.incsearch = true
vim.opt.termguicolors = true
vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes"
vim.opt.isfname:append("@-@")
-- https://www.reddit.com/r/vim/comments/3ql651/what_do_you_set_your_updatetime_to/
vim.opt.updatetime = 50
vim.opt.colorcolumn = "80"
-- vim.opt.cmdheight = 0
-- vim.opt.showmode = false
-- vim.opt.showcmd = false
-- vim.opt.shortmess:append("F")
-- vim.api.nvim_set_keymap('n', ':', '<cmd>FineCmdline<CR>', {noremap = true})