half of this is very broken

but it only breaks every two years so who cares
This commit is contained in:
sadan 2024-07-11 19:48:02 -04:00
parent dfd9f2d265
commit 6587ce62cc
No known key found for this signature in database
7 changed files with 259 additions and 11 deletions

View file

@ -73,3 +73,22 @@ vim.keymap.set("n", "<leader>e", function()
vim.api.nvim_feedkeys((":e " .. string.gsub(vim.fn.expand("%"), "(.*/)(.*)", "%1")), "L", false)
end)
vim.keymap.set("n", "<leader>c", ":let @+=@\"<CR>")
-- training
vim.keymap.set("n", "<Left>", ':echoe "Use h"<CR>')
vim.keymap.set("n", "<Right>", ':echoe "Use l"<CR>')
vim.keymap.set("n", "<Up>", ':echoe "Use k"<CR>')
vim.keymap.set("n", "<Down>", ':echoe "Use j"<CR>')
vim.keymap.set("i", "<Left>", '<ESC>:echoe "Use h"<CR>i')
vim.keymap.set("i", "<Right>", '<ESC>:echoe "Use l"<CR>i')
vim.keymap.set("i", "<Up>", '<ESC>:echoe "Use k"<CR>i')
vim.keymap.set("i", "<Down>", '<ESC>:echoe "Use j"<CR>i')
-- https://stackoverflow.com/questions/1841480/how-to-use-lowercase-marks-as-global-in-vim
-- Use lowercase for global marks and uppercase for local marks.
local low = function(i) return string.char(97+i) end
local upp = function(i) return string.char(65+i) end
for i=0,25 do vim.keymap.set("n", "m"..low(i), "m"..upp(i)) end
for i=0,25 do vim.keymap.set("n", "m"..upp(i), "m"..low(i)) end
for i=0,25 do vim.keymap.set("n", "'"..low(i), "'"..upp(i)) end
for i=0,25 do vim.keymap.set("n", "'"..upp(i), "'"..low(i)) end

View file

@ -1,17 +1,17 @@
local pkgs = {
"nixpkgs-fmt",
"jdtls",
"yaml-language-server",
"eslint_d",
"yaml-language-server",
"eslint_d",
}
local reg = require("mason-registry")
for _, pname in ipairs(pkgs) do
for _, pname in ipairs(pkgs) do
local pkg = reg.get_package(pname)
if not pkg:is_installed() then
print(string.format("[masonDownload.lua]: %s is not installed. Installing.", pname))
local handle = pkg:install(nil)
--while handle.state ~= "CLOSED" do
-- print(handle.stdout)
-- end
local handle = pkg:install(nil)
--while handle.state ~= "CLOSED" do
-- print(handle.stdout)
-- end
end
end

View file

@ -1,7 +1,42 @@
local plugins = {
{
"akinsho/bufferline.nvim",
version = "*",
dependencies = "nvim-tree/nvim-web-devicons",
},
{
"mfussenegger/nvim-jdtls"
"akinsho/toggleterm.nvim"
},
{
dir = "/home/meyer/dev/lua/vencord.nvim",
},
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
},
{
"kdheepak/lazygit.nvim",
cmd = {
"LazyGit",
"LazyGitConfig",
"LazyGitCurrentFile",
"LazyGitFilter",
"LazyGitFilterCurrentFile",
},
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
},
-- setting the keybinding for LazyGit with 'keys' is recommended in
-- order to load the plugin when the command is run for the first time
keys = {
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" },
},
},
{
"mfussenegger/nvim-jdtls",
},
{
"olrtg/nvim-emmet",
},
@ -105,6 +140,17 @@ local plugins = {
{
"nvim-telescope/telescope.nvim",
tag = "0.1.5",
opts = {
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
case_mode = "ignore_case", -- or "ignore_case" or "respect_case" or smart_case
-- the default case_mode is "smart_case"
},
},
},
dependencies = { "nvim-lua/plenary.nvim" },
},
{

View file

@ -24,3 +24,6 @@ require("setupsig")
require("setuplualine")
require("setupDiscord")
require('telescope').load_extension('fzf')
require("setupbufferline")
require("setupterminal")

View file

@ -5,18 +5,18 @@ require("presence").setup({
neovim_image_text = "A text editor of all time", -- Text displayed when hovered over the Neovim image
main_image = "neovim", -- Main image display (either "neovim" or "file")
client_id = "793271441293967371", -- Use your own Discord application client id (not recommended)
log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
log_level = "error", -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
debounce_timeout = 5, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(<filename>, true)`)
enable_line_number = true, -- Displays the current line number instead of the current project
blacklist = { "nitro" }, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
buttons = {
{
label = "Git",
url = "https://github.com/sadanslargehole",
url = "https://github.com/sadan4",
},
{
label = "My website",
url = "https://sadanslargehole.com",
url = "https://sadan.zip",
},
}, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
file_assets = {}, -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)

117
lua/setupbufferline.lua Normal file
View file

@ -0,0 +1,117 @@
vim.opt.termguicolors = true
require("bufferline").setup({
options = {
mode = "buffers",
numbers = "buffer_id",
indicator = {
-- icon = "| ",
style = "icon",
},
color_icons = true, -- whether or not to add the filetype icon highlights
},
})
-- {
-- options = {
-- mode = "buffers", -- set to "tabs" to only show tabpages instead
-- style_preset = bufferline.style_preset.default, -- or bufferline.style_preset.minimal,
-- themable = true | false, -- allows highlight groups to be overriden i.e. sets highlights as default
-- numbers = "none" | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
-- close_command = "bdelete! %d", -- can be a string | function, | false see "Mouse actions"
-- right_mouse_command = "bdelete! %d", -- can be a string | function | false, see "Mouse actions"
-- left_mouse_command = "buffer %d", -- can be a string | function, | false see "Mouse actions"
-- middle_mouse_command = nil, -- can be a string | function, | false see "Mouse actions"
-- indicator = {
-- icon = '▎', -- this should be omitted if indicator style is not 'icon'
-- style = 'icon' | 'underline' | 'none',
-- },
-- buffer_close_icon = '󰅖',
-- modified_icon = '●',
-- close_icon = '',
-- left_trunc_marker = '',
-- right_trunc_marker = '',
-- --- name_formatter can be used to change the buffer's label in the bufferline.
-- --- Please note some names can/will break the
-- --- bufferline so use this at your discretion knowing that it has
-- --- some limitations that will *NOT* be fixed.
-- name_formatter = function(buf) -- buf contains:
-- -- name | str | the basename of the active file
-- -- path | str | the full path of the active file
-- -- bufnr (buffer only) | int | the number of the active buffer
-- -- buffers (tabs only) | table(int) | the numbers of the buffers in the tab
-- -- tabnr (tabs only) | int | the "handle" of the tab, can be converted to its ordinal number using: `vim.api.nvim_tabpage_get_number(buf.tabnr)`
-- end,
-- max_name_length = 18,
-- max_prefix_length = 15, -- prefix used when a buffer is de-duplicated
-- truncate_names = true, -- whether or not tab names should be truncated
-- tab_size = 18,
-- diagnostics = false | "nvim_lsp" | "coc",
-- diagnostics_update_in_insert = false,
-- -- The diagnostics indicator can be set to nil to keep the buffer name highlight but delete the highlighting
-- diagnostics_indicator = function(count, level, diagnostics_dict, context)
-- return "("..count..")"
-- end,
-- -- NOTE: this will be called a lot so don't do any heavy processing here
-- custom_filter = function(buf_number, buf_numbers)
-- -- filter out filetypes you don't want to see
-- if vim.bo[buf_number].filetype ~= "<i-dont-want-to-see-this>" then
-- return true
-- end
-- -- filter out by buffer name
-- if vim.fn.bufname(buf_number) ~= "<buffer-name-I-dont-want>" then
-- return true
-- end
-- -- filter out based on arbitrary rules
-- -- e.g. filter out vim wiki buffer from tabline in your work repo
-- if vim.fn.getcwd() == "<work-repo>" and vim.bo[buf_number].filetype ~= "wiki" then
-- return true
-- end
-- -- filter out by it's index number in list (don't show first buffer)
-- if buf_numbers[1] ~= buf_number then
-- return true
-- end
-- end,
-- offsets = {
-- {
-- filetype = "NvimTree",
-- text = "File Explorer" | function ,
-- text_align = "left" | "center" | "right"
-- separator = true
-- }
-- },
-- color_icons = true | false, -- whether or not to add the filetype icon highlights
-- get_element_icon = function(element)
-- -- element consists of {filetype: string, path: string, extension: string, directory: string}
-- -- This can be used to change how bufferline fetches the icon
-- -- for an element e.g. a buffer or a tab.
-- -- e.g.
-- local icon, hl = require('nvim-web-devicons').get_icon_by_filetype(element.filetype, { default = false })
-- return icon, hl
-- -- or
-- local custom_map = {my_thing_ft: {icon = "my_thing_icon", hl}}
-- return custom_map[element.filetype]
-- end,
-- show_buffer_icons = true | false, -- disable filetype icons for buffers
-- show_buffer_close_icons = true | false,
-- show_close_icon = true | false,
-- show_tab_indicators = true | false,
-- show_duplicate_prefix = true | false, -- whether to show duplicate buffer prefix
-- duplicates_across_groups = true, -- whether to consider duplicate paths in different groups as duplicates
-- persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
-- move_wraps_at_ends = false, -- whether or not the move command "wraps" at the first or last position
-- -- can also be a table containing 2 custom separators
-- -- [focused and unfocused]. eg: { '|', '|' }
-- separator_style = "slant" | "slope" | "thick" | "thin" | { 'any', 'any' },
-- enforce_regular_tabs = false | true,
-- always_show_bufferline = true | false,
-- auto_toggle_bufferline = true | false,
-- hover = {
-- enabled = true,
-- delay = 200,
-- reveal = {'close'}
-- },
-- sort_by = 'insert_after_current' |'insert_at_end' | 'id' | 'extension' | 'relative_directory' | 'directory' | 'tabs' | function(buffer_a, buffer_b)
-- -- add custom logic
-- return buffer_a.modified > buffer_b.modified
-- end
-- }
-- }

63
lua/setupterminal.lua Normal file
View file

@ -0,0 +1,63 @@
require("toggleterm").setup({
-- size can be a number or function which is passed the current terminal
-- size = 20 | function(term)
-- if term.direction == "horizontal" then
-- return 15
-- elseif term.direction == "vertical" then
-- return vim.o.columns * 0.4
-- end
-- end,
open_mapping = [[<leader>`]], -- or { [[<c-\>]], [[<c-¥>]] } if you also use a Japanese keyboard.
hide_numbers = true, -- hide the number column in toggleterm buffers
shade_filetypes = {},
autochdir = false, -- when neovim changes it current directory the terminal will change it's own when next it's opened
-- highlights = {
-- -- highlights which map to a highlight group name and a table of it's values
-- -- NOTE: this is only a subset of values, any group placed here will be set for the terminal window split
-- Normal = {
-- -- guibg = "<VALUE-HERE>",
-- },
-- NormalFloat = {
-- link = "Normal",
-- },
-- FloatBorder = {
-- guifg = "<VALUE-HERE>",
-- guibg = "<VALUE-HERE>",
-- },
-- },
shade_terminals = true, -- NOTE: this option takes priority over highlights specified so if you specify Normal highlights you should set this to false
-- shading_factor = "<number>", -- the percentage by which to lighten dark terminal background, default: -30
-- shading_ratio = "<number>", -- the ratio of shading factor for light/dark terminal background, default: -3
start_in_insert = true,
insert_mappings = true, -- whether or not the open mapping applies in insert mode
terminal_mappings = true, -- whether or not the open mapping applies in the opened terminals
persist_size = true,
persist_mode = true, -- if set to true (default) the previous terminal mode will be remembered
direction = "horizontal",
close_on_exit = true, -- close the terminal window when the process exits
-- Change the default shell. Can be a string or a function returning a string
shell = vim.o.shell,
auto_scroll = true, -- automatically scroll to the bottom on terminal output
-- This field is only relevant if direction is set to 'float'
-- float_opts = {
-- -- The border key is *almost* the same as 'nvim_open_win'
-- -- see :h nvim_open_win for details on borders however
-- -- the 'curved' border is a custom border type
-- -- not natively supported but implemented in this plugin.
-- border = 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open
-- -- like `size`, width, height, row, and col can be a number or function which is passed the current terminal
-- width = <value>,
-- height = <value>,
-- row = <value>,
-- col = <value>,
-- winblend = 3,
-- zindex = <value>,
-- title_pos = 'left' | 'center' | 'right', position of the title of the floating window
-- },
-- winbar = {
-- enabled = false,
-- name_formatter = function(term) -- term: Terminal
-- return term.name
-- end,
-- },
})