diff --git a/configs/feh/buttons b/configs/feh/buttons new file mode 100644 index 0000000..a5355e9 --- /dev/null +++ b/configs/feh/buttons @@ -0,0 +1,6 @@ +# Unbind existing scroll operations +prev_img +next_img +# Set +zoom_in 4 +zoom_out 5 diff --git a/configs/nvim/after/plugin/auto-pair.lua b/configs/nvim/after/plugin/auto-pair.lua deleted file mode 100644 index 32c46b6..0000000 --- a/configs/nvim/after/plugin/auto-pair.lua +++ /dev/null @@ -1,30 +0,0 @@ --- -- import nvim-autopairs safely --- local autopairs_setup, autopairs = pcall(require, "nvim-autopairs") --- if not autopairs_setup then --- return --- end --- --- -- configure autopairs --- autopairs.setup({ --- check_ts = true, -- enable treesitter --- ts_config = { --- lua = { "string" }, -- don't add pairs in lua string treesitter nodes --- javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes --- java = false, -- don't check treesitter on java --- }, --- }) --- --- -- import nvim-autopairs completion functionality safely --- local cmp_autopairs_setup, cmp_autopairs = pcall(require, "nvim-autopairs.completion.cmp") --- if not cmp_autopairs_setup then --- return --- end --- --- -- import nvim-cmp plugin safely (completions plugin) --- local cmp_setup, cmp = pcall(require, "cmp") --- if not cmp_setup then --- return --- end --- --- -- make autopairs and completion work together --- cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) diff --git a/configs/nvim/after/plugin/bar.lua b/configs/nvim/after/plugin/bar.lua deleted file mode 100644 index 9f6e348..0000000 --- a/configs/nvim/after/plugin/bar.lua +++ /dev/null @@ -1,98 +0,0 @@ --- Set barbar's options -require'bufferline'.setup() --- -- Enable/disable animations --- animation = true, --- --- -- Enable/disable auto-hiding the tab bar when there is a single buffer --- auto_hide = false, --- --- -- Enable/disable current/total tabpages indicator (top right corner) --- tabpages = true, --- --- -- Enable/disable close button --- closable = true, --- --- -- Enables/disable clickable tabs --- -- - left-click: go to buffer --- -- - middle-click: delete buffer --- clickable = true, --- --- -- Enables / disables diagnostic symbols --- diagnostics = { --- -- you can use a list --- {enabled = true, icon = 'ff'}, -- ERROR --- {enabled = false}, -- WARN --- {enabled = false}, -- INFO --- {enabled = true}, -- HINT --- --- -- OR `vim.diagnostic.severity` --- [vim.diagnostic.severity.ERROR] = {enabled = true, icon = 'ff'}, --- [vim.diagnostic.severity.WARN] = {enabled = false}, --- [vim.diagnostic.severity.INFO] = {enabled = false}, --- [vim.diagnostic.severity.HINT] = {enabled = true}, --- }, --- --- -- Excludes buffers from the tabline --- exclude_ft = {'javascript'}, --- exclude_name = {'package.json'}, --- --- -- Hide inactive buffers and file extensions. Other options are `alternate`, `current`, and `visible`. --- hide = {extensions = true, inactive = true}, --- --- -- Disable highlighting alternate buffers --- highlight_alternate = false, --- --- -- Disable highlighting file icons in inactive buffers --- highlight_inactive_file_icons = false, --- --- -- Enable highlighting visible buffers --- highlight_visible = true, --- --- -- Enable/disable icons --- -- if set to 'numbers', will show buffer index in the tabline --- -- if set to 'both', will show buffer index and icons in the tabline --- icons = true, --- --- -- If set, the icon color will follow its corresponding buffer --- -- highlight group. By default, the Buffer*Icon group is linked to the --- -- Buffer* group (see Highlighting below). Otherwise, it will take its --- -- default value as defined by devicons. --- icon_custom_colors = false, --- --- -- Configure icons on the bufferline. --- icon_separator_active = '▎', --- icon_separator_inactive = '▎', --- icon_close_tab = '', --- icon_close_tab_modified = '●', --- icon_pinned = '車', --- --- -- If true, new buffers will be inserted at the start/end of the list. --- -- Default is to insert after current buffer. --- insert_at_end = false, --- insert_at_start = false, --- --- -- Sets the maximum padding width with which to surround each tab --- maximum_padding = 1, --- --- -- Sets the minimum padding width with which to surround each tab --- minimum_padding = 1, --- --- -- Sets the maximum buffer name length. --- maximum_length = 30, --- --- -- If set, the letters for each buffer in buffer-pick mode will be --- -- assigned based on their name. Otherwise or in case all letters are --- -- already assigned, the behavior is to assign letters in order of --- -- usability (see order below) --- semantic_letters = true, --- --- -- New buffer letters are assigned in this order. This order is --- -- optimal for the qwerty keyboard layout but might need adjustement --- -- for other layouts. --- letters = 'asdfjkl;ghnmxcvbziowerutyqpASDFJKLGHNMXCVBZIOWERUTYQP', --- --- -- Sets the name of unnamed buffers. By default format is "[Buffer X]" --- -- where X is the buffer number. But only a static string is accepted here. --- no_name_title = nil, --- } --- diff --git a/configs/nvim/after/plugin/cmp.lua b/configs/nvim/after/plugin/cmp.lua deleted file mode 100644 index 294016d..0000000 --- a/configs/nvim/after/plugin/cmp.lua +++ /dev/null @@ -1,47 +0,0 @@ -local status, cmp = pcall(require, "cmp") -if not status then - return -end -local lspkind = require("lspkind") -local cmp_select = { behavior = cmp.SelectBehavior.Select } - -cmp.setup({ - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.select_prev_item(cmp_select), - [""] = cmp.mapping.select_next_item(cmp_select), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.close(), - [""] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }), - }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "buffer" }, - { name = 'luasnip'}, - { name = 'path'} - }), - formatting = { - format = lspkind.cmp_format({ with_text = false, maxwidth = 40 }), - }, -}) - -vim.api.nvim_set_keymap('i', '', 'luasnip#expand_or_jumpable() ? "luasnip-expand-or-jump" : ""', {expr=true, silent=true}) -vim.api.nvim_set_keymap('i', '', 'lua require("luasnip").jump(-1)', {silent=true}) -vim.api.nvim_set_keymap('s', '', 'lua require("luasnip").jump(1)', {silent=true}) -vim.api.nvim_set_keymap('s', '', 'lua require("luasnip").jump(-1)', {silent=true}) -vim.api.nvim_set_keymap('i', '', 'luasnip#choice_active() ? "luasnip-next-choice" : ""', {expr=true, silent=true}) -vim.api.nvim_set_keymap('s', '', 'luasnip#choice_active() ? "luasnip-next-choice" : ""', {expr=true, silent=true}) - -vim.cmd([[ - set completeopt=menuone,noinsert,noselect - highlight! default link CmpItemKind CmpItemMenuDefault -]]) diff --git a/configs/nvim/after/plugin/colorizer.lua b/configs/nvim/after/plugin/colorizer.lua index b99a3c2..2f3ba95 100644 --- a/configs/nvim/after/plugin/colorizer.lua +++ b/configs/nvim/after/plugin/colorizer.lua @@ -3,4 +3,13 @@ if not status then return end -colorizer.setup() +colorizer.setup{ + css = { + rgb_fn = true; + rgb = true; + names = true; + }; + html = { + names = true; + } +} diff --git a/configs/nvim/after/plugin/feline.lua b/configs/nvim/after/plugin/feline.lua deleted file mode 100644 index cdac439..0000000 --- a/configs/nvim/after/plugin/feline.lua +++ /dev/null @@ -1,296 +0,0 @@ ----depends om https://github.com/feline-nvim/feline.nvim -local present, feline = pcall(require, "feline") - -if not present then - return -end - -local theme = { - aqua = "#7AB0DF", - bg = "#1C212A", - blue = "#5FB0FC", - cyan = "#70C0BA", - darkred = "#FB7373", - fg = "#C7C7CA", - gray = "#222730", - green = "#79DCAA", - lime = "#54CED6", - orange = "#FFD064", - pink = "#D997C8", - purple = "#C397D8", - red = "#F87070", - yellow = "#FFE59E" -} - -local mode_theme = { - ["NORMAL"] = theme.green, - ["OP"] = theme.cyan, - ["INSERT"] = theme.aqua, - ["VISUAL"] = theme.yellow, - ["LINES"] = theme.darkred, - ["BLOCK"] = theme.orange, - ["REPLACE"] = theme.purple, - ["V-REPLACE"] = theme.pink, - ["ENTER"] = theme.pink, - ["MORE"] = theme.pink, - ["SELECT"] = theme.darkred, - ["SHELL"] = theme.cyan, - ["TERM"] = theme.lime, - ["NONE"] = theme.gray, - ["COMMAND"] = theme.blue, -} - -local component = {} - -component.vim_mode = { - provider = function() - return vim.api.nvim_get_mode().mode:upper() - end, - hl = function() - return { - fg = "bg", - bg = require("feline.providers.vi_mode").get_mode_color(), - style = "bold", - name = "NeovimModeHLColor", - } - end, - left_sep = "block", - right_sep = "block", -} - -component.git_branch = { - provider = "git_branch", - hl = { - fg = "fg", - bg = "bg", - style = "bold", - }, - left_sep = "block", - right_sep = "", -} - -component.git_add = { - provider = "git_diff_added", - hl = { - fg = "green", - bg = "bg", - }, - left_sep = "", - right_sep = "", -} - -component.git_delete = { - provider = "git_diff_removed", - hl = { - fg = "red", - bg = "bg", - }, - left_sep = "", - right_sep = "", -} - -component.git_change = { - provider = "git_diff_changed", - hl = { - fg = "purple", - bg = "bg", - }, - left_sep = "", - right_sep = "", -} - -component.separator = { - provider = "", - hl = { - fg = "bg", - bg = "bg", - }, -} - -component.diagnostic_errors = { - provider = "diagnostic_errors", - hl = { - fg = "red", - }, -} - -component.diagnostic_warnings = { - provider = "diagnostic_warnings", - hl = { - fg = "yellow", - }, -} - -component.diagnostic_hints = { - provider = "diagnostic_hints", - hl = { - fg = "aqua", - }, -} - -component.diagnostic_info = { - provider = "diagnostic_info", -} - -component.lsp = { - provider = function() - if not rawget(vim, "lsp") then - return "" - end - - local progress = vim.lsp.util.get_progress_messages()[1] - if vim.o.columns < 120 then - return "" - end - - local clients = vim.lsp.get_active_clients({ bufnr = 0 }) - if #clients ~= 0 then - if progress then - local spinners = { - "◜ ", - "◠ ", - "◝ ", - "◞ ", - "◡ ", - "◟ ", - } - local ms = vim.loop.hrtime() / 1000000 - local frame = math.floor(ms / 120) % #spinners - local content = string.format("%%<%s", spinners[frame + 1]) - return content or "" - else - return "לּ LSP" - end - end - return "" - end, - hl = function() - local progress = vim.lsp.util.get_progress_messages()[1] - return { - fg = progress and "yellow" or "green", - bg = "gray", - style = "bold", - } - end, - left_sep = "", - right_sep = "block", -} - -component.file_type = { - provider = { - name = "file_type", - opts = { - filetype_icon = true, - }, - }, - hl = { - fg = "fg", - bg = "gray", - }, - left_sep = "block", - right_sep = "block", -} - -component.scroll_bar = { - provider = function() - local chars = { - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - } - local line_ratio = vim.api.nvim_win_get_cursor(0)[1] / vim.api.nvim_buf_line_count(0) - local position = math.floor(line_ratio * 100) - - if position <= 5 then - position = " TOP" - elseif position >= 95 then - position = " BOT" - else - position = chars[math.floor(line_ratio * #chars)] .. position - end - return position - end, - hl = function() - local position = math.floor(vim.api.nvim_win_get_cursor(0)[1] / vim.api.nvim_buf_line_count(0) * 100) - local fg - local style - - if position <= 5 then - fg = "aqua" - style = "bold" - elseif position >= 95 then - fg = "red" - style = "bold" - else - fg = "purple" - style = nil - end - return { - fg = fg, - style = "bold", - bg = "bg", - } - end, - left_sep = "block", - right_sep = "block", -} - -local left = { - component.vim_mode, -} -local middle = {} -local right = { - component.file_type, - component.lsp, - component.git_branch, - component.git_add, - component.git_delete, - component.git_change, - component.separator, - component.diagnostic_errors, - component.diagnostic_warnings, - component.diagnostic_info, - component.diagnostic_hints, - component.scroll_bar, -} - -local components = { - active = { - left, - middle, - right, - }, -} - -feline.setup({ - components = components, - theme = theme, - vi_mode_colors = mode_theme, -}) - ----vim:filetype=lua diff --git a/configs/nvim/after/plugin/files.lua b/configs/nvim/after/plugin/files.lua deleted file mode 100644 index 28c4309..0000000 --- a/configs/nvim/after/plugin/files.lua +++ /dev/null @@ -1,24 +0,0 @@ --- function ColorMyPencils(color) --- color = color or "rose-pine" --- vim.cmd.colorscheme(color) --- --- vim.api.nvim_set_hl(0, "Normal", { bg = "none"}) --- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none"}) --- end --- --- ColorMyPencils() -require("transparent").setup({ - enable = true, -- boolean: enable transparent - extra_groups = { -- table/string: additional groups that should be cleared - -- In particular, when you set it to 'all', that means all available groups - - -- example of akinsho/nvim-bufferline.lua - "BufferLineTabClose", - "BufferlineBufferSelected", - "BufferLineFill", - "BufferLineBackground", - "BufferLineSeparator", - "BufferLineIndicatorSelected", - }, - exclude = {}, -- table: groups you don't want to clear -}) diff --git a/configs/nvim/after/plugin/harpoon.lua b/configs/nvim/after/plugin/harpoon.lua index 7ab7c47..35518e2 100644 --- a/configs/nvim/after/plugin/harpoon.lua +++ b/configs/nvim/after/plugin/harpoon.lua @@ -6,9 +6,11 @@ vim.keymap.set("n", "a", mark.add_file) vim.keymap.set("n", "", ui.toggle_quick_menu) -vim.keymap.set("n", "", function() ui.nav_file(1) end) -vim.keymap.set("n", "", function() ui.nav_file(2) end) -vim.keymap.set("n", "", function() ui.nav_file(3) end) -vim.keymap.set("n", "", function() ui.nav_file(4) end) +vim.keymap.set("n", "", function() ui.nav_file(1) end) +vim.keymap.set("n", "", function() ui.nav_file(2) end) +vim.keymap.set("n", "", function() ui.nav_file(3) end) +vim.keymap.set("n", "", function() ui.nav_file(4) end) +vim.keymap.set("n", "", function() ui.nav_file(5) end) +vim.keymap.set("n", "", function() ui.nav_file(6) end) vim.keymap.set("n", "t", function() term.gotoTerminal(1) end) diff --git a/configs/nvim/after/plugin/lsp-zero.lua b/configs/nvim/after/plugin/lsp-zero.lua new file mode 100644 index 0000000..0dea1e1 --- /dev/null +++ b/configs/nvim/after/plugin/lsp-zero.lua @@ -0,0 +1,189 @@ +-- ufo +vim.o.foldcolumn = "1" +vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value +vim.o.foldlevelstart = 99 +vim.o.foldenable = true + +-- Using ufo provider need remap `zR` and `zM`. +vim.keymap.set("n", "zR", require("ufo").openAllFolds) +vim.keymap.set("n", "zM", require("ufo").closeAllFolds) + +require("ufo").setup() + +local lsp = require("lsp-zero") + +lsp.preset("lsp-only") + +lsp.ensure_installed({ + "tsserver", + "eslint", + "pyright", + "lua_ls", + "rust_analyzer", +}) + +-- Fix Undefined global 'vim' +lsp.configure("lua_ls", { + settings = { + Lua = { + diagnostics = { + globals = { "vim" }, + }, + }, + }, +}) + +lsp.set_preferences({ + suggest_lsp_servers = false, + sign_icons = { + error = "E", + warn = "W", + hint = "H", + info = "I", + }, +}) + +lsp.set_server_config({ + on_init = function(client) + client.server_capabilities.semanticTokensProvider = nil + end, + capabilities = { + textDocument = { + completion = { + completionItem = { + snippetSupport = true, + }, + }, + foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true, + }, + }, + }, +}) + +lsp.on_attach(function(client, bufnr) + local opts = { buffer = bufnr, remap = false } + + -- if client.name == "eslint" then + -- vim.cmd.LspStop("eslint") + -- return + -- end + + vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) + vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts) + vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) + vim.keymap.set("n", "vws", vim.lsp.buf.workspace_symbol, opts) + vim.keymap.set("n", "vd", vim.diagnostic.open_float, opts) + vim.keymap.set("n", "[d", vim.diagnostic.goto_next, opts) + vim.keymap.set("n", "]d", vim.diagnostic.goto_prev, opts) + vim.keymap.set("n", "vca", vim.lsp.buf.code_action, opts) + vim.keymap.set("n", "vrr", vim.lsp.buf.references, opts) + vim.keymap.set("n", "vrn", vim.lsp.buf.rename, opts) + vim.keymap.set("i", "", vim.lsp.buf.signature_help, opts) +end) + +-- local cmp_autopairs_setup, cmp_autopairs = pcall(require, "nvim-autopairs.completion.cmp") +-- if not cmp_autopairs_setup then +-- return +-- end +-- +-- cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) +require("luasnip.loaders.from_vscode").lazy_load() + +lsp.setup() + +vim.diagnostic.config({ + virtual_text = true, +}) + +local null_ls = require("null-ls") + +null_ls.setup({ + sources = { + null_ls.builtins.formatting.black, + }, +}) + +-- See mason-null-ls.nvim's documentation for more details: +-- https://github.com/jay-babu/mason-null-ls.nvim#setup +require("mason-null-ls").setup({ + ensure_installed = nil, + automatic_installation = false, + handlers = {}, +}) + +local cmp = require("cmp") +local cmp_select = { behavior = cmp.SelectBehavior.Select } +local cmp_autopairs = require("nvim-autopairs.completion.cmp") +local cmp_action = require("lsp-zero").cmp_action() + +cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + sorting = { + -- TODO: Would be cool to add stuff like "See variable names before method names" in rust, or something like that. + comparators = { + cmp.config.compare.offset, + cmp.config.compare.exact, + cmp.config.compare.score, + + -- copied from cmp-under, but I don't think I need the plugin for this. + -- I might add some more of my own. + 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, + cmp.config.compare.length, + cmp.config.compare.order, + }, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.select_prev_item(cmp_select), + [""] = cmp.mapping.select_next_item(cmp_select), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.close(), + [""] = cmp_action.luasnip_supertab(), + [""] = cmp_action.luasnip_shift_supertab(), + [""] = cmp.mapping.confirm({ + select = false, + }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + }), + formatting = { + fields = { "kind", "abbr", "menu" }, + format = function(entry, vim_item) + local kind = require("lspkind").cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item) + local strings = vim.split(kind.kind, "%s", { trimempty = true }) + kind.kind = " " .. (strings[1] or "") .. " " + kind.menu = " (" .. (strings[2] or "") .. ")" + + return kind + end, + }, + window = { + completion = cmp.config.window.bordered({}), + documentation = cmp.config.window.bordered({}), + }, +}) +cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) diff --git a/configs/nvim/after/plugin/lsp.lua b/configs/nvim/after/plugin/lsp.lua deleted file mode 100644 index 9cc4303..0000000 --- a/configs/nvim/after/plugin/lsp.lua +++ /dev/null @@ -1,98 +0,0 @@ -local lsp = require('lsp-zero') - -lsp.preset('recommended') - -lsp.ensure_installed({ - 'tsserver', - 'eslint', - 'pyright', - 'sumneko_lua', - 'rust_analyzer', -}) - - --- Fix Undefined global 'vim' -lsp.configure('sumneko_lua', { - settings = { - Lua = { - diagnostics = { - globals = { 'vim' } - } - } - } -}) - - -local cmp = require('cmp') -local cmp_select = { behavior = cmp.SelectBehavior.Select } -local cmp_mappings = lsp.defaults.cmp_mappings({ - [''] = cmp.mapping.select_prev_item(cmp_select), - [''] = cmp.mapping.select_next_item(cmp_select), - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping.complete(), -}) - --- disable completion with tab --- this helps with copilot setup -cmp_mappings[''] = nil -cmp_mappings[''] = nil - -lsp.setup_nvim_cmp({ - mapping = cmp_mappings -}) - - - -lsp.set_preferences({ - suggest_lsp_servers = false, - sign_icons = { - error = 'E', - warn = 'W', - hint = 'H', - info = 'I' - } -}) - -lsp.on_attach(function(client, bufnr) - local opts = { buffer = bufnr, remap = false } - - if client.name == "eslint" then - vim.cmd.LspStop('eslint') - return - end - - vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) - vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) - vim.keymap.set("n", "vws", vim.lsp.buf.workspace_symbol, opts) - vim.keymap.set("n", "vd", vim.diagnostic.open_float, opts) - vim.keymap.set("n", "[d", vim.diagnostic.goto_next, opts) - vim.keymap.set("n", "]d", vim.diagnostic.goto_prev, opts) - vim.keymap.set("n", "vca", vim.lsp.buf.code_action, opts) - vim.keymap.set("n", "vrr", vim.lsp.buf.references, opts) - vim.keymap.set("n", "vrn", vim.lsp.buf.rename, opts) - vim.keymap.set("i", "", vim.lsp.buf.signature_help, opts) -end) - --- local cmp_autopairs_setup, cmp_autopairs = pcall(require, "nvim-autopairs.completion.cmp") --- if not cmp_autopairs_setup then --- return --- end --- --- cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) -require("luasnip.loaders.from_vscode").lazy_load() - - -lsp.setup() - -vim.diagnostic.config({ - virtual_text = true, -}) - -local mason_nullls = require("mason-null-ls") -mason_nullls.setup({ - automatic_installation = true, - automatic_setup = true, -}) -mason_nullls.setup_handlers({}) diff --git a/configs/nvim/after/plugin/lspkind.lua b/configs/nvim/after/plugin/lspkind.lua index 72ca5c2..5d0af14 100644 --- a/configs/nvim/after/plugin/lspkind.lua +++ b/configs/nvim/after/plugin/lspkind.lua @@ -6,42 +6,40 @@ lspkind.init({ -- -- default: true mode = 'symbol', - -- default symbol map -- can be either 'default' (requires nerd-fonts font) or -- 'codicons' for codicon preset (requires vscode-codicons font) -- -- default: 'default' preset = 'codicons', - -- override preset symbols -- -- default: {} symbol_map = { - Text = "", - Method = "", - Function = "", - Constructor = "", - Field = "ﰠ", - Variable = "", - Class = "ﴯ", - Interface = "", - Module = "", - Property = "ﰠ", - Unit = "塞", - Value = "", - Enum = "", - Keyword = "", - Snippet = "", - Color = "", - File = "", - Reference = "", - Folder = "", - EnumMember = "", - Constant = "", - Struct = "פּ", - Event = "", - Operator = "", - TypeParameter = "" + Text = "", + Method = " ", + Function = " ", + Constructor = " ", + Field = " ", + Variable = " ", + Class = "ﴯ ", + Interface = " ", + Module = " ", + Property = "ﰠ ", + Unit = " ", + Value = " ", + Enum = " ", + Keyword = " ", + Snippet = " ", + Color = " ", + File = " ", + Reference = " ", + Folder = " ", + EnumMember = " ", + Constant = " ", + Struct = " ", + Event = " ", + Operator = " ", + TypeParameter = " " }, }) diff --git a/configs/nvim/after/plugin/lspsaga.lua b/configs/nvim/after/plugin/lspsaga.lua index aa3691a..9e427a0 100644 --- a/configs/nvim/after/plugin/lspsaga.lua +++ b/configs/nvim/after/plugin/lspsaga.lua @@ -9,6 +9,7 @@ saga.setup({ title = true, -- Border type can be single, double, rounded, solid, shadow. border = "rounded", + -- theme ="round", winblend = 0, expand = "", collapse = "", @@ -25,8 +26,8 @@ vim.keymap.set("n", "", "Lspsaga diagnostic_jump_next", opts) vim.keymap.set("n", "K", "Lspsaga hover_doc", opts) -- vim.keymap.set('n', 'gd', 'Lspsaga lsp_finder', opts) vim.keymap.set("i", "", "Lspsaga signature_help", opts) -vim.keymap.set("n", "gp", "Lspsaga preview_definition", opts) -vim.keymap.set("n", "gr", "Lspsaga rename", opts) +vim.keymap.set("n", "gp", "Lspsaga peek_definition", opts) +vim.keymap.set("n", "gr", "Lspsaga rename", opts) -- code action local codeaction = require("lspsaga.codeaction") diff --git a/configs/nvim/after/plugin/lualine.lua b/configs/nvim/after/plugin/lualine.lua deleted file mode 100644 index 89ec5c5..0000000 --- a/configs/nvim/after/plugin/lualine.lua +++ /dev/null @@ -1,43 +0,0 @@ -local status, lualine = pcall(require, "lualine") -if (not status) then return end - -lualine.setup { - options = { - icons_enabled = true, - theme = 'solarized_dark', - section_separators = { left = '', right = '' }, - component_separators = { left = '', right = '' }, - disabled_filetypes = {} - }, - sections = { - lualine_a = { 'mode' }, - lualine_b = { 'branch' }, - lualine_c = { { - 'filename', - file_status = true, -- displays file status (readonly status, modified status) - path = 0 -- 0 = just filename, 1 = relative path, 2 = absolute path - } }, - lualine_x = { - { 'diagnostics', sources = { "nvim_diagnostic" }, symbols = { error = ' ', warn = ' ', info = ' ', - hint = ' ' } }, - 'encoding', - 'filetype' - }, - lualine_y = { 'progress' }, - lualine_z = { 'location' } - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { { - 'filename', - file_status = true, -- displays file status (readonly status, modified status) - path = 1 -- 0 = just filename, 1 = relative path, 2 = absolute path - } }, - lualine_x = { 'location' }, - lualine_y = {}, - lualine_z = {} - }, - tabline = {}, - extensions = { 'fugitive' } -} diff --git a/configs/nvim/after/plugin/mason-lsp.lua b/configs/nvim/after/plugin/mason-lsp.lua deleted file mode 100644 index 37bcce6..0000000 --- a/configs/nvim/after/plugin/mason-lsp.lua +++ /dev/null @@ -1,58 +0,0 @@ -require("mason").setup() -require("mason-lspconfig").setup({ - ensure_installed = { "lua_ls", "rust_analyzer", "pyright", "cssls", "hls", "html", "tsserver" }, -}) - -local status, nvim_lsp = pcall(require, "lspconfig") -if not status then - return -end - -require("mason").setup() - -require("mason-lspconfig").setup({ - ensure_installed = { - "rust_analyzer", - "tsserver", - "html", - "pyright" - }, -}) - -local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities() -local lsp_attach = function(client, bufnr) - local opts = { buffer = bufnr, remap = false } - -- Create your keybindings here... - if client.name == "eslint" then - vim.cmd.LspStop("eslint") - return - end - - vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) - vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) - vim.keymap.set("n", "vws", vim.lsp.buf.workspace_symbol, opts) - vim.keymap.set("n", "vd", vim.diagnostic.open_float, opts) - vim.keymap.set("n", "[d", vim.diagnostic.goto_next, opts) - vim.keymap.set("n", "]d", vim.diagnostic.goto_prev, opts) - vim.keymap.set("n", "vca", vim.lsp.buf.code_action, opts) - vim.keymap.set("n", "vrr", vim.lsp.buf.references, opts) - vim.keymap.set("n", "vrn", vim.lsp.buf.rename, opts) - vim.keymap.set("i", "", vim.lsp.buf.signature_help, opts) -end - -require("luasnip.loaders.from_vscode").lazy_load() - -local lspconfig = require("lspconfig") -require("mason-lspconfig").setup_handlers({ - function(server_name) - lspconfig[server_name].setup({ - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - on_attach = lsp_attach, - capabilities = lsp_capabilities, - }) - end, -}) diff --git a/configs/nvim/after/plugin/neosolarized.lua b/configs/nvim/after/plugin/neosolarized.lua index a31a89c..0195b43 100644 --- a/configs/nvim/after/plugin/neosolarized.lua +++ b/configs/nvim/after/plugin/neosolarized.lua @@ -13,6 +13,7 @@ local Group = cb.Group local groups = cb.groups local styles = cb.styles +Color.new('white', '#ffffff') Color.new('black', '#000000') Group.new('CursorLine', colors.none, colors.base03, styles.NONE, colors.base1) Group.new('CursorLineNr', colors.yellow, colors.black, styles.NONE, colors.base1) @@ -32,10 +33,11 @@ Group.new("DiagnosticUnderlineWarn", colors.none, colors.none, styles.undercurl, Group.new("DiagnosticUnderlineInfo", colors.none, colors.none, styles.undercurl, cInfo) Group.new("DiagnosticUnderlineHint", colors.none, colors.none, styles.undercurl, cHint) Group.new("Macro", groups.PreProc, colors.none, styles.italic + styles.bold) -Group.new("Function", groups.Function, colors.none, styles.italic) +Group.link("Function", groups.Function, colors.none, styles.italic) Group.new("Conditional", groups.Statement, colors.none, styles.italic) Group.new("Boolean", groups.Constant, colors.none, styles.bold) --- +Group.new("HoverBorder", colors.yellow, colors.none, styles.NONE) + -- local success, solarized = pcall(require, 'solarized') -- -- if not success then @@ -51,3 +53,10 @@ Group.new("Boolean", groups.Constant, colors.none, styles.bold) -- solarized.setup(default_config) -- -- vim.cmd 'colorscheme solarized' +-- +-- local g = vim.g +-- g.nord_contrast = true +-- g.nord_borders = false +-- g.nord_italic = true +-- g.nord_bold = true +-- require("nord").set() diff --git a/configs/nvim/after/plugin/null-ls.lua b/configs/nvim/after/plugin/null-ls.lua deleted file mode 100644 index edf26e6..0000000 --- a/configs/nvim/after/plugin/null-ls.lua +++ /dev/null @@ -1,25 +0,0 @@ -local status, null_ls = pcall(require, "null-ls") -if not status then - return -end - -require("mason-null-ls").setup({ - automatic_setup = true, - ensure_installed = { "rust", "javascript", "typescript", "html", "css", "python", "ruby" }, -}) - -require("mason-null-ls").setup_handlers({ - function(source_name, methods) - -- all sources with no handler get passed here - - -- To keep the original functionality of `automatic_setup = true`, - -- please add the below. - require("mason-null-ls.automatic_setup")(source_name, methods) - end, - stylua = function(source_name, methods) - null_ls.register(null_ls.builtins.formatting.stylua) - end, -}) - --- will setup any installed and configured sources above -null_ls.setup() diff --git a/configs/nvim/after/plugin/null.lua b/configs/nvim/after/plugin/null.lua deleted file mode 100644 index a8c7948..0000000 --- a/configs/nvim/after/plugin/null.lua +++ /dev/null @@ -1,17 +0,0 @@ -local null_ls_status_ok, null_ls = pcall(require, "null-ls") -if not null_ls_status_ok then - return -end - -local formatting = null_ls.builtins.formatting -local diagnostics = null_ls.builtins.diagnostics - -null_ls.setup({ - debug = false, - sources = { - formatting.prettier.with({ extra_args = {"--no-semi"}}), - formatting.black.with({ extra_args = {"--fast"}}), - -- formatting.rustfmt({}), - }, -}) - diff --git a/configs/nvim/after/plugin/telescope.lua b/configs/nvim/after/plugin/telescope.lua index aa84500..af9c1e9 100644 --- a/configs/nvim/after/plugin/telescope.lua +++ b/configs/nvim/after/plugin/telescope.lua @@ -9,8 +9,6 @@ local function telescope_buffer_dir() return vim.fn.expand("%:p:h") end -local fb_actions = require("telescope").extensions.file_browser.actions - telescope.setup({ defaults = { mappings = { @@ -19,45 +17,7 @@ telescope.setup({ }, }, }, - extensions = { - file_browser = { - theme = "dropdown", - -- disables netrw and use telescope-file-browser in its place - hijack_netrw = true, - mappings = { - -- your custom insert mode mappings - ["i"] = { - [""] = function() - vim.cmd("normal vbd") - end, - }, - ["n"] = { - -- your custom normal mode mappings - ["N"] = fb_actions.create, - ["R"] = fb_actions.rename, - ["h"] = fb_actions.goto_parent_dir, - ["/"] = function() - vim.cmd("startinsert") - end, - }, - }, - }, - }, }) -telescope.load_extension("file_browser") - -vim.keymap.set("n", "sf", function() - telescope.extensions.file_browser.file_browser({ - path = "%:p:h", - cwd = telescope_buffer_dir(), - respect_gitignore = false, - hidden = true, - grouped = true, - previewer = false, - initial_mode = "normal", - layout_config = { height = 40 }, - }) -end) vim.keymap.set("n", "pf", builtin.find_files, {}) vim.keymap.set("n", "", builtin.git_files, {}) diff --git a/configs/nvim/after/plugin/transparent.lua b/configs/nvim/after/plugin/transparent.lua index 41eb347..8137edc 100644 --- a/configs/nvim/after/plugin/transparent.lua +++ b/configs/nvim/after/plugin/transparent.lua @@ -1,8 +1,10 @@ require("transparent").setup({ - enable = true, -- boolean: enable transparent - extra_groups = { -- table/string: additional groups that should be cleared - "all", - }, - exclude = {}, -- table: groups you don't want to clear - ignore_linked_group = true, -- boolean: don't clear a group that links to another group + -- enable = true, -- boolean: enable transparent + -- extra_groups = { -- table/string: additional groups that should be cleared + -- "all", + -- }, + -- exclude = {}, -- table: groups you don't want to clear + -- ignore_linked_group = true, -- boolean: don't clear a group that links to another group }) + +vim.cmd[[TransparentEnable]] diff --git a/configs/nvim/after/plugin/tree.lua b/configs/nvim/after/plugin/tree.lua deleted file mode 100644 index 7eac352..0000000 --- a/configs/nvim/after/plugin/tree.lua +++ /dev/null @@ -1,20 +0,0 @@ --- require("nvim-tree").setup({ --- sort_by = "case_sensitive", --- -- view = { --- -- adaptive_size = true, --- -- prefer_startup_root = true, --- -- update_focused_file = { --- -- { update_root = true }, --- -- }, --- -- mappings = { --- -- list = { --- -- { key = "u", action = "dir_up" }, --- -- }, --- -- }, --- renderer = { --- group_empty = true, --- }, --- filters = { --- dotfiles = true, --- }, --- }) diff --git a/configs/nvim/after/plugin/treesitter.lua b/configs/nvim/after/plugin/treesitter.lua index fd02580..646f4db 100644 --- a/configs/nvim/after/plugin/treesitter.lua +++ b/configs/nvim/after/plugin/treesitter.lua @@ -1,51 +1,51 @@ -require 'nvim-treesitter.configs'.setup { - -- a list of parser names, or "all" - ensure_installed = { - "help", - "python", - "javascript", - "c", - "lua", - "rust", - "bash", - "gitignore", - "vim", - "markdown", - "html", - "css", - }, +require("nvim-treesitter.configs").setup({ + -- a list of parser names, or "all" + ensure_installed = { + "help", + "python", + "javascript", + "c", + "lua", + "rust", + "bash", + "gitignore", + "vim", + "markdown", + "html", + "css", + }, - -- install parsers synchronously (only applied to `ensure_installed`) - sync_install = true, + -- install parsers synchronously (only applied to `ensure_installed`) + sync_install = true, - -- automatically install missing parsers when entering buffer - -- recommendation: set to false if you don't have `tree-sitter` cli installed locally - auto_install = true, + -- 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 = { - -- `false` will disable the whole extension - 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, - }, + highlight = { + -- `false` will disable the whole extension + 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, + }, - autotag = { - enable = true, - }, + autotag = { + enable = true, + }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = "", - node_decremental = "", - }, - }, -} + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = "", + node_decremental = "", + }, + }, +}) -local parser_config = require "nvim-treesitter.parsers".get_parser_configs() +local parser_config = require("nvim-treesitter.parsers").get_parser_configs() parser_config.tsx.filetype_to_parsername = { "javascript", "typescript.tsx" } diff --git a/configs/nvim/init.lua b/configs/nvim/init.lua index de72923..5b606c5 100644 --- a/configs/nvim/init.lua +++ b/configs/nvim/init.lua @@ -9,7 +9,3 @@ if vim.g.neovide then -- vim.cmd("hi Normal guibg=#78997a") end -vim.g.solarized_italic_comments = true -vim.g.solarized_italic_keywords = false -vim.g.solarized_italic_functions = true -vim.g.solarized_italic_variables = false diff --git a/configs/nvim/lua/jabuxas/bar.lua b/configs/nvim/lua/jabuxas/bar.lua deleted file mode 100644 index 4a88fd7..0000000 --- a/configs/nvim/lua/jabuxas/bar.lua +++ /dev/null @@ -1,43 +0,0 @@ -local map = vim.api.nvim_set_keymap -local opts = { noremap = true, silent = true } - --- Move to previous/next -map('n', '', 'BufferPrevious', opts) -map('n', '', 'BufferNext', opts) --- Re-order to previous/next -map('n', '', 'BufferMovePrevious', opts) -map('n', '>', 'BufferMoveNext', opts) --- Goto buffer in position... -map('n', '', 'BufferGoto 1', opts) -map('n', '', 'BufferGoto 2', opts) -map('n', '', 'BufferGoto 3', opts) -map('n', '', 'BufferGoto 4', opts) -map('n', '', 'BufferGoto 5', opts) -map('n', '', 'BufferGoto 6', opts) -map('n', '', 'BufferGoto 7', opts) -map('n', '', 'BufferGoto 8', opts) -map('n', '', 'BufferGoto 9', opts) -map('n', '', 'BufferLast', opts) --- Pin/unpin buffer -map('n', '', 'BufferPin', opts) --- Close buffer -map('n', '', 'BufferClose', opts) --- Wipeout buffer --- :BufferWipeout --- Close commands --- :BufferCloseAllButCurrent --- :BufferCloseAllButPinned --- :BufferCloseAllButCurrentOrPinned --- :BufferCloseBuffersLeft --- :BufferCloseBuffersRight --- Magic buffer-picking mode -map('n', '', 'BufferPick', opts) --- Sort automatically by... -map('n', 'bb', 'BufferOrderByBufferNumber', opts) -map('n', 'bd', 'BufferOrderByDirectory', opts) -map('n', 'bl', 'BufferOrderByLanguage', opts) -map('n', 'bw', 'BufferOrderByWindowNumber', opts) - --- Other: --- :BarbarEnable - enables barbar (enabled by default) --- :BarbarDisable - very bad command, should never be used diff --git a/configs/nvim/lua/jabuxas/init.lua b/configs/nvim/lua/jabuxas/init.lua index b6a6b87..fefdb0b 100644 --- a/configs/nvim/lua/jabuxas/init.lua +++ b/configs/nvim/lua/jabuxas/init.lua @@ -1,4 +1,3 @@ require("jabuxas.remap") require("jabuxas.set") -require("jabuxas.bar") require("jabuxas.packer") diff --git a/configs/nvim/lua/jabuxas/packer.lua b/configs/nvim/lua/jabuxas/packer.lua index 2f75976..72808a4 100644 --- a/configs/nvim/lua/jabuxas/packer.lua +++ b/configs/nvim/lua/jabuxas/packer.lua @@ -36,7 +36,12 @@ return require("packer").startup(function(use) }) use("norcalli/nvim-colorizer.lua") use("ThePrimeagen/vim-be-good") - use("declancm/maximize.nvim") + use({ + "declancm/maximize.nvim", + config = function() + require("maximize").setup() + end, + }) use("andweeb/presence.nvim") use("nvim-lualine/lualine.nvim") use({ @@ -52,13 +57,10 @@ return require("packer").startup(function(use) "hrsh7th/nvim-cmp", }) use("nvim-telescope/telescope.nvim") - use("nvim-telescope/telescope-file-browser.nvim") - use({ "akinsho/bufferline.nvim", tag = "v3.*", requires = "nvim-tree/nvim-web-devicons" }) use({ "glepnir/lspsaga.nvim", branch = "main", }) - use({ "romgrk/barbar.nvim", requires = "nvim-web-devicons" }) use({ "jose-elias-alvarez/null-ls.nvim", "jay-babu/mason-null-ls.nvim", @@ -73,11 +75,45 @@ return require("packer").startup(function(use) }) use({ "xiyaowong/nvim-transparent", - config = function() - require("transparent").setup({ enable = true }) - vim.g.transparent_percentage = 80 - end, + -- config = function() + -- require("transparent").setup({ enable = true }) + -- vim.g.transparent_percentage = 80 + -- end, }) use("folke/zen-mode.nvim") use("folke/lsp-colors.nvim") + use("AlexvZyl/nordic.nvim") + use({ + "VonHeikemen/lsp-zero.nvim", + branch = "v2.x", + requires = { + -- LSP Support + { "neovim/nvim-lspconfig" }, -- Required + { + -- Optional + "williamboman/mason.nvim", + run = function() + pcall(vim.cmd, "MasonUpdate") + end, + }, + { "williamboman/mason-lspconfig.nvim" }, -- Optional + + -- Autocompletion + { "hrsh7th/nvim-cmp" }, -- Required + { "hrsh7th/cmp-nvim-lsp" }, -- Required + { "L3MON4D3/LuaSnip" }, -- Required + { "jay-babu/mason-null-ls.nvim" }, + }, + }) + use({ "kevinhwang91/nvim-ufo", requires = "kevinhwang91/promise-async" }) + use("shaunsingh/nord.nvim") + use("sindrets/diffview.nvim") + -- install without yarn or npm + use({ + "iamcco/markdown-preview.nvim", + run = function() + vim.fn["mkdp#util#install"]() + end, + }) + use("mattn/emmet-vim") end) diff --git a/configs/nvim/lua/jabuxas/remap.lua b/configs/nvim/lua/jabuxas/remap.lua index df76103..afd6399 100644 --- a/configs/nvim/lua/jabuxas/remap.lua +++ b/configs/nvim/lua/jabuxas/remap.lua @@ -1,12 +1,10 @@ local keymap = vim.keymap -local nvim_tmux_nav = require('nvim-tmux-navigation') - +local nvim_tmux_nav = require("nvim-tmux-navigation") keymap.set("n", "pv", vim.cmd.Ex) -keymap.set("i", "jk", "") vim.g.mapleader = " " -keymap.set("n", "pv", vim.cmd.Ex) +keymap.set("n", "sf", vim.cmd.Ex) -- keymap.set("n", "e", vim.cmd.NreeToggle) keymap.set("v", "J", ":m '>+1gv=gv") @@ -45,11 +43,22 @@ keymap.set("n", "sx", ":close") keymap.set("n", "s=", "+") keymap.set("n", "s-", "-") -keymap.set('n', "", nvim_tmux_nav.NvimTmuxNavigateLeft) -keymap.set('n', "", nvim_tmux_nav.NvimTmuxNavigateDown) -keymap.set('n', "", nvim_tmux_nav.NvimTmuxNavigateUp) -keymap.set('n', "", nvim_tmux_nav.NvimTmuxNavigateRight) -keymap.set('n', "", nvim_tmux_nav.NvimTmuxNavigateLastActive) -keymap.set('n', "", nvim_tmux_nav.NvimTmuxNavigateNext) -keymap.set('n', 'sm', "lua require('maximize').toggle()") +keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateLeft) +keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateDown) +keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateUp) +keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateRight) +keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateLastActive) +keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateNext) +keymap.set("n", "sm", "lua require('maximize').toggle()") +keymap.set("n", "d", "DiffviewFileHistory %") +keymap.set("n", "+", "") +keymap.set("n", "-", "") +keymap.set("n", "", "<") +keymap.set("n", "", ">") +keymap.set("n", "", "+") +keymap.set("n", "", "-") + +keymap.set("n", "e", function () + vim.cmd(string.format("Emmet %s", vim.fn.input("Emmet: "))) +end) diff --git a/configs/nvim/lua/jabuxas/set.lua b/configs/nvim/lua/jabuxas/set.lua index d3db488..baaa1b5 100644 --- a/configs/nvim/lua/jabuxas/set.lua +++ b/configs/nvim/lua/jabuxas/set.lua @@ -43,7 +43,13 @@ vim.opt.termguicolors = true vim.cmd([[let &t_Cs = "\e[4:3m"]]) vim.cmd([[let &t_Ce = "\e[4:0m"]]) --- vim.o.foldcolumn = 1 --- vim.o.foldlevel = 99 --- vim.o.foldlevelstart= 0 --- vim.o.foldenable = true +vim.g.netrw_browse_split = 0 +vim.g.netrw_banner = 0 +vim.g.netrw_winsize = 25 + +vim.g.user_emmet_leader_key = "," +vim.g.user_emmet_install_global = 0 + +local autocmd = vim.api.nvim_create_autocmd +autocmd("FileType", {pattern = "html", command = [[EmmetInstall]]}) +autocmd("FileType", {pattern = "css", command = [[EmmetInstall]]}) diff --git a/configs/picom/picom.conf b/configs/picom/picom.conf index 2ac991b..4ba6e59 100644 --- a/configs/picom/picom.conf +++ b/configs/picom/picom.conf @@ -16,7 +16,7 @@ rounded-corners-exclude = [ "class_g = 'Conky'", "class_g = 'Thunderbird'", "class_g ?= 'xfce4-panel' && window_type = 'dock'", - "class_g = 'xmobar'" + "class_g ?= 'xmobar' && window_type = 'dock'" ]; round-borders = 1; round-borders-exclude = [ @@ -35,8 +35,7 @@ round-borders-rule = [ "3:class_g = 'XTerm'", "3:class_g = 'URxvt'", "10:class_g = 'Alacritty'", - "15:class_g = 'Signal'", - "0:class_g = 'xmobar'" + "15:class_g = 'Signal'" ]; ################################# @@ -176,10 +175,12 @@ opacity-rule = [ "90:class_g = 'URxvt'", # "100:class_g = 'kitty'", "95:class_g = 'Emacs'", + "95:class_g = 'obsidian'", "100:class_g = 'Alacritty'", "100:class_g = 'Polybar'", "100:class_g = 'code-oss'", "100:class_g = 'Meld'", + "100:class_g = 'xfce4-panel'", "70:class_g = 'TelegramDesktop'", "90:class_g = 'Joplin'", "100:class_g = 'firefox'", @@ -207,39 +208,36 @@ opacity-rule = [ # Parameters for background blurring, see the *BLUR* section for more information. # blur-method = blur: { -# requires: https://github.com/ibhagwan/picom method = "dual_kawase"; -#method = "kernel"; - strength = 2; - deviation = 1.0; - size = 2; -# kernel = "11x11gaussian"; + strength = 4; + deviation = 2; + size = 4; background = false; background-frame = false; background-fixed = false; kern = "3x3box"; } # -blur-deviation = false +# blur-deviation = false # -blur-strength = 5 +# blur-strength = 5 # Blur background of semi-transparent / ARGB windows. # Bad in performance, with driver-dependent behavior. # The name of the switch may change without prior notifications. # -blur-background = true; +# blur-background = true; # Blur background of windows when the window frame is not opaque. # Implies: # blur-background # Bad in performance, with driver-dependent behavior. The name may change. # -blur-background-frame = false; +# blur-background-frame = false; # Use fixed blur strength rather than adjusting according to window opacity. -blur-background-fixed = true; +# blur-background-fixed = true; # Specify the blur convolution kernel, with the following format: diff --git a/configs/tmux/plugins/rose-pine-tmux b/configs/tmux/plugins/rose-pine-tmux new file mode 160000 index 0000000..4675ad4 --- /dev/null +++ b/configs/tmux/plugins/rose-pine-tmux @@ -0,0 +1 @@ +Subproject commit 4675ad4adf92d0d51c48b70e92fa8eb0b85a8986 diff --git a/configs/tmux/plugins/tmux-colors-solarized b/configs/tmux/plugins/tmux-colors-solarized new file mode 160000 index 0000000..4d07f3c --- /dev/null +++ b/configs/tmux/plugins/tmux-colors-solarized @@ -0,0 +1 @@ +Subproject commit 4d07f3cc1ce2bdc0c8391290c5b0cf098abddddc diff --git a/configs/tmux/plugins/tmux-ludanta b/configs/tmux/plugins/tmux-ludanta new file mode 160000 index 0000000..9558530 --- /dev/null +++ b/configs/tmux/plugins/tmux-ludanta @@ -0,0 +1 @@ +Subproject commit 95585303a70bb39b17d37b6f2b362b4237fb3265 diff --git a/configs/tmux/plugins/tokyo-night-tmux b/configs/tmux/plugins/tokyo-night-tmux new file mode 160000 index 0000000..9bba871 --- /dev/null +++ b/configs/tmux/plugins/tokyo-night-tmux @@ -0,0 +1 @@ +Subproject commit 9bba871bd7af93026715b5b232fa3e9e3d9e7a01 diff --git a/configs/tmux/tmux.conf b/configs/tmux/tmux.conf index 4cdae2a..5d4e26a 100644 --- a/configs/tmux/tmux.conf +++ b/configs/tmux/tmux.conf @@ -2,7 +2,7 @@ set -g prefix C-a unbind C-b bind-key C-a send-prefix -set -g default-terminal "screen-256color" +set -g default-terminal "tmux-256color" set-option -sa terminal-overrides ",xterm-kitty:RGB" unbind % @@ -14,6 +14,8 @@ bind _ split-window -v unbind r bind r source-file ~/.config/tmux/tmux.conf +bind C-z set-option -g status + bind -r j resize-pane -D 5 bind -r k resize-pane -U 5 bind -r l resize-pane -R 5 @@ -52,13 +54,21 @@ bind-key -T copy-mode-vi 'C-Space' select-pane -t:.+ set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' -set -g @plugin 'jimeh/tmux-themepack' -set -g @themepack 'powerline/default/yellow' +# set -g @plugin 'jimeh/tmux-themepack' set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @plugin 'tmux-plugins/tmux-continuum' +# set -g @plugin 'seebi/tmux-colors-solarized' +# set -g @plugin "vladovidiu/rose-pine-tmux" +set -g @plugin "janoamaral/tokyo-night-tmux" +set -g @plugin 'vascomfnunes/tmux-ludanta' + set -g @resurrect-capture-pane-contents 'on' set -g @continuum-restore 'on' +set -g status-right "#{mpd_now_playing}" + +# set -g @colors-solarized 'light' +# set -g status off run '~/.config/tmux/plugins/tpm/tpm' diff --git a/configs/xmonad/3 b/configs/xmonad/3 new file mode 100644 index 0000000..16a9c39 --- /dev/null +++ b/configs/xmonad/3 @@ -0,0 +1,546 @@ +{-# LANGUAGE + MultiWayIf -- Required for `toggleFull` in `myAdditionalKeys` + , LambdaCase -- Required for `(\case)` statement in `myXmobarPP` + , FlexibleContexts + , OverloadedStrings +#-} +{-# OPTIONS_GHC -Wno-missing-signatures + -Wno-orphans #-} + +-- Data Imports + +import Data.Functor +import Data.List (isInfixOf) +import qualified Data.Map as M +import Data.Monoid +-- Used in io exitSuccess + +import System.Environment (getEnv) +import System.Exit +import System.IO.Unsafe (unsafeDupablePerformIO) +-- XMonad imports +import XMonad +import XMonad.Actions.NoBorders (toggleBorder) +import XMonad.Actions.ToggleFullFloat +import XMonad.Hooks.DebugEvents +import XMonad.Hooks.EwmhDesktops +import XMonad.Hooks.ManageDebug +import XMonad.Hooks.ManageDocks +import XMonad.Hooks.ManageHelpers +import XMonad.Hooks.SetWMName +import XMonad.Hooks.StatusBar +import XMonad.Hooks.StatusBar.PP +import XMonad.Hooks.UrgencyHook (doAskUrgent) +import XMonad.Hooks.WindowSwallowing +import XMonad.Layout.FocusTracking +import XMonad.Layout.Fullscreen +import XMonad.Layout.NoBorders +import XMonad.Layout.Spacing +import qualified XMonad.StackSet as W +import XMonad.Util.ClickableWorkspaces +import XMonad.Util.Cursor +import XMonad.Util.EZConfig +import qualified XMonad.Util.Hacks as Hacks +import XMonad.Util.NamedScratchpad +import XMonad.Util.SpawnOnce +import XMonad.Util.Ungrab + +-- import qualified DBus as D +-- import qualified DBus.Client as D + +main :: IO () +main = + do + xmonad + $ debugManageHookOn "M-S-d" + . docks + . setEwmhActivateHook doAskUrgent + -- . ewmhFullscreen -- breaks league of legends + . toggleFullFloatEwmhFullscreen + -- . fullscreenSupport -- breaks game launchers #450 + . ewmh -- modal dialogs #452 + . Hacks.javaHack + -- . withEasySB xmobar toggleSB + -- . withSB xmobar2 + $ myConfig + -- where + -- toggleSB XConfig {modMask = modm} = (modm, xK_m) + +myModMask :: KeyMask +myModMask = mod4Mask + +-- Default Terminal +myTerminal :: String +myTerminal = "kitty" + +-- Default Launcher +myLauncher :: String +myLauncher = myHomeDir ++ "/.config/rofi/launchers/type-6/launcher.sh" + +-- Default Launcher +myFileManager :: String +-- myFileManager = "kitty -e ranger" +myFileManager = "thunar" + +-- Default Browser +myBrowser :: String +myBrowser = "brave-bin" + +myPowerMenu :: String +myPowerMenu = myHomeDir ++ "/.config/rofi/powermenu/type-6/powermenu.sh" + +-- Workspaces +myWorkspaces :: [String] +myWorkspaces = ["term", "www", "comms", "games", "misc", "vm", "trash", "stm"] +-- myWorkspaces = map show [1 .. 9] + +-- Border Width +myBorderWidth :: Dimension +myBorderWidth = 2 + +-- Formal Unfocused Color +myNormColor :: String +myNormColor = "#383830" + +-- Focused Color +myFocusColor :: String +myFocusColor = "#cb4b16" + +-- Home Directory +myHomeDir :: String +myHomeDir = unsafeDupablePerformIO (getEnv "HOME") + +-- focus follows the mouse pointer +myFocusFollowsMouse :: Bool +myFocusFollowsMouse = True + +myKeys conf@(XConfig {XMonad.modMask = modm}) = + M.fromList $ + [ ((m .|. modm, k), windows $ f i) + | (i, k) <- zip (XMonad.workspaces conf) [xK_1, xK_2, xK_3, xK_4, xK_5, xK_6, xK_7, xK_8, xK_9, xK_0], + (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)] + ] + ++ [ ((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f)) + | (key, sc) <- zip [xK_comma, xK_period, xK_semicolon] [0 ..], + (f, m) <- [(W.view, 0), (W.shift, shiftMask)] + ] + +myAdditionalKeys :: [(String, X ())] +myAdditionalKeys = + base + ++ window + ++ applications + ++ multimedia + where + -- Force killing a frozen window. + forceKillWindow :: Window -> X () + forceKillWindow w = withDisplay $ \d -> + io $ void $ killClient d w + -- Making a window have a full float over a workspace. + toggleFull :: Window -> X () + toggleFull w = windows $ \s -> + if + | M.lookup w (W.floating s) == Just fullscreen -> W.sink w s + | otherwise -> W.float w fullscreen s + where + fullscreen = W.RationalRect 0 0 1 1 + -- Screenshots + screenShotSelection = myHomeDir ++ "/.local/bin/print-select" :: String + screenShotFullscreen = myHomeDir ++ "/.local/bin/print-fullscreen" :: String + screenShotTmp = myHomeDir ++ "/.local/bin/print-tmp" :: String + screenShotApp = myHomeDir ++ "/.local/bin/print-window.sh" :: String + -- XMonad base keybinds. + base = + [ ("M-g", withFocused toggleBorder), + ("M-S-c", kill), + ("M-S-x", withFocused forceKillWindow), + ("M-", sendMessage NextLayout), + ("M-n", refresh), + ("M-S-q", io exitSuccess), + ("C-S-r", spawn "xmonad --recompile && killall xmobar2 ; killall xmobar ; xmonad --restart"), + ("C-S-q", spawn "pkill -KILL -u $USER") + ] + -- Window management keybinds. + window = + [ ("M-", windows W.focusDown), + ("M-j", windows W.focusDown), + ("M-k", windows W.focusUp), + ("M-S-m", windows W.focusMaster), + ("M-m", sendMessage ToggleStruts), + ("M-p", windows W.swapMaster), + ("M-S-j", windows W.swapDown), + ("M-S-h", windows W.swapDown), + ("M-S-k", windows W.swapUp), + ("M-S-l", windows W.swapUp), + ("M-h", sendMessage Shrink), + ("M-l", sendMessage Expand), + ("M-t", withFocused $ windows . W.sink), + ("M-f", withFocused toggleFull), + ("M-C-S-6", withFocused $ \w -> spawn $ "xprop -id " ++ show w ++ " | ${XMONAD_XMESSAGE:-xmessage} -file -"), + ("M-S-f", withFocused toggleFullFloat) + ] + -- Spawning applications. + applications = + [ ("M-", spawn myTerminal), + ("M-S-m", namedScratchpadAction myScratchpads "ncmpcpp"), + ("M-C-", namedScratchpadAction myScratchpads "terminal"), + ("M-S-", spawn myPowerMenu), + ("M-b", spawn myBrowser), + ("M-v", spawn "code"), + ("M-S-s", spawn "flatpak run com.valvesoftware.Steam --noverifyfiles"), + ("S-", unGrab *> spawn screenShotSelection), + ("C-S-", unGrab *> spawn screenShotTmp), + ("C-", unGrab *> spawn screenShotApp), + ("", spawn screenShotFullscreen), + ("M-S-", spawn myLauncher), + -- ("M1-", spawn myWinSwitch), + ("M-e", spawn myFileManager), + ("C-S-m", spawn "~/scripts/macro.sh") + ] + -- Multimedia keybinds. + multimedia = + [ ("", spawn "playerctl play-pause"), + ("", spawn "playerctl previous"), + ("", spawn "playerctl next"), + ("", spawn "pactl set-sink-mute @DEFAULT_SINK@ toggle"), + ("", spawn "pactl set-sink-volume @DEFAULT_SINK@ -1.5%"), + ("", spawn "pactl set-sink-volume @DEFAULT_SINK@ +1.5%"), + ("", spawn "amixer sset Capture toggle"), + ("M-", spawn "mpc toggle"), + ("M-", spawn "mpc prev"), + ("M-", spawn "mpc next") + ] + +myMouseBindings :: XConfig l -> M.Map (KeyMask, Button) (Window -> X ()) +myMouseBindings XConfig {XMonad.modMask = modm} = + M.fromList + -- Set the window to floating mode and move by dragging. + [ ((modm, button1), \w -> focus w >> mouseMoveWindow w >> windows W.shiftMaster), + -- Raise the window to the top of the stack. + ((modm, button2), \w -> focus w >> windows W.shiftMaster), + -- Set the window to floating mode and resize by dragging. + ((modm, button3), \w -> focus w >> mouseResizeWindow w >> windows W.shiftMaster) + ] + +myStartupHook :: X () +myStartupHook = do + -- _ <- + -- traverse + -- spawnOnce + -- [ "sh ~/scripts/screenlayout.sh", + -- "feh --bg-center ~/Pictures/wallpapers/felca.jpg", + -- "touch ~/tmp/touchy && rm -rf ~/tmp/*", + -- myHomeDir ++ "/.local/bin/picom-ibhagwan -b --experimental-backends &", + -- "xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Profile Enabled' 0, 1 && xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Speed' 0.5", + -- "setxkbmap -option ctrl:nocaps br abnt2", + -- "trayer-srg --edge top --align right --SetDockType true --SetPartialStrut true --expand true --widthtype request --tint 0x2F2F2F --height 25 --distance 0 --margin 0 --alpha 0 --monitor 1 --transparent true", -- normal bar + -- -- "trayer-srg --edge bottom --align right --SetDockType true --SetPartialStrut true --expand true --widthtype request --tint 0x002b36 --height 30 --transparent false --distance 1 --margin 6 --alpha 0 --monitor 0 --transparent true", -- spaced bar + -- "dunst &", + -- "lxqt-policykit-agent &", + -- "xrdb -load ~/.Xresources", + -- -- "redshift -t 4500:2500 -l -23.5475:-46.63611" + -- ] + setDefaultCursor xC_left_ptr + setWMName "xfce+xmonad" + +isInstance (ClassApp c _) = className =? c +isInstance (TitleApp t _) = title =? t +isInstance (NameApp n _) = appName =? n + +type AppName = String + +type AppTitle = String + +type AppClassName = String + +type AppCommand = String + +data App + = ClassApp AppClassName AppCommand + | TitleApp AppTitle AppCommand + | NameApp AppName AppCommand + deriving (Show) + +gimp = ClassApp "Gimp" "gimp" + +gimp2 = ClassApp "Gimp-2.99" "gimp-2.99" + +multimc = ClassApp "MultiMC" "MultiMC" + +about = TitleApp "About Mozilla Firefox" "About Mozilla Firefox" + +message = ClassApp "Xmessage" "Xmessage" + +myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet) + +-- Like '=?' but matches substrings. +q =?? x = fmap (isInfixOf x) q + +myManageHook = manageRules + where + -- Hides windows without ignoring it, see doHideIgnore in XMonad contrib. + doHide = ask >>= doF . W.delete :: ManageHook + -- WM_WINDOW_ROLE will be parsed with the role variable. + isRole = stringProperty "WM_WINDOW_ROLE" + -- To match multiple properties with one operator. + anyOf = foldl (<||>) (pure False) :: [Query Bool] -> Query Bool + -- To match multiple classNames with one operator. + match = anyOf . fmap isInstance :: [App] -> Query Bool + -- Checking for splash dialogs. + isSplash = isInProperty "_NET_WM_WINDOW_TYPE" "_NET_WM_WINDOW_TYPE_SPLASH" + -- Checking for pop-ups. + isPopup = isRole =? "pop-up" + -- Checking for file chooser dialog. + isFileChooserDialog = isRole =? "GtkFileChooserDialog" + -- Managing rules for applications. + manageRules = + composeOne + [ transience, + isDialog -?> doCenterFloat, + isFullscreen -?> (doF W.focusDown <> doFullFloat), + match + [ gimp, + gimp2, + about, + message + ] + -?> doFloat, + match + [ multimc + ] + -?> doCenterFloat, + anyOf + [ isFileChooserDialog, + isDialog, + isPopup, + isSplash + ] + -?> doCenterFloat + ] + <> composeAll + [ manageDocks <> namedScratchpadManageHook myScratchpads, + className =? "firefox" <&&> title =? "File Upload" --> doFloat, + className =? "firefox" <&&> title =? "Library" --> doCenterFloat, + className =? "firefox" <&&> title ^? "Save" --> doFloat, + className =? "firefox" <&&> resource =? "Toolkit" --> doFloat, + className =? "firefox" <&&> title ^? "Sign in" --> doFloat, + className ^? "jetbrains-" <&&> title ^? "Welcome to " --> doCenterFloat, + className ^? "jetbrains-" <&&> title =? "splash" --> doFloat, + className ^? "Visual " <&&> isDialog --> doCenterFloat, + className =? "firefox-esr" --> doShift "www", + className =? "Chromium-browser-chromium" --> doShift "www", + className =? "Brave-browser" --> doShift "www", + className =? "Virt-manager" --> doShift "vm", + className =? "discord" --> doShift "comms", + className =? "discord-screenaudio" --> doShift "comms", + className =? "Spotify" --> doShift "msc", + className =? "thunderbird" --> doShift "trash", + className =? "Steam" --> doShift "stm", + className =? "steam" --> doShift "stm", + className =? "steamwebhelper" --> doShift "stm", + className =? "obs" --> doShift "misc", + className =? "Lutris" --> doShift "misc", + className =? "PrismLauncher" --> doShift "misc", + className =? "explorer.exe" --> doShift "games", + className =? "starrail.exe" --> doShift "games", + className =? "An Anime Game Launcher" --> doShift "misc" <> doCenterFloat <> hasBorder False, + className =? "heroic" --> doShift "misc" <> doCenterFloat <> hasBorder False, + className =? "riotclientux.exe" --> doShift "games", + className =?? "dauntless" --> doShift "games", + className =? "battle.net.exe" --> doShift "games" <> doFloat, + className =? "Pcmanfm" --> doFloat, + className =? "Thunar" --> doFloat, + className =? "Pavucontrol" --> doFloat, + className =? "Nitrogen" --> doFloat, + className =? "Wrapper-2.0" --> doFloat, + className =? "TeamSpeak 3" --> doShift "comms", + className =? "easyeffects" --> doFloat <> doShift "misc", + className =? "Arandr" --> doFloat, + resource =? "desktop_window" --> doIgnore, + resource =? "kdesktop" --> doIgnore, + className =? "Conky" --> doIgnore, + isRole ^? "About" <||> isRole ^? "about" --> doFloat, + "_NET_WM_WINDOW_TYPE" `isInProperty` "_KDE_NET_WM_WINDOW_TYPE_OVERRIDE" --> doIgnore <> doRaise, + -- Steam Game Fixes + className =? "steam_app_1551360" <&&> title /=? "Forza Horizon 5" --> doHide, -- Prevents black screen when fullscreening. + className =? "Steam" <&&> title ~? "News" --> doHide, + className =? "Xfce4-panel" --> doCenterFloat <> hasBorder False, + className =?? "league" --> doShift "games" <> doCenterFloat <> hasBorder False, + className =?? "deceive" --> doShift "games" <> doCenterFloat <> hasBorder False, + className =?? "riot" --> doShift "games" <> doCenterFloat <> hasBorder False, + className =?? "Minecraft" --> doShift "games" <> doCenterFloat <> hasBorder False, + className =?? "csgo" --> doShift "games" <> doCenterFloat <> hasBorder False, + className =? "gamescope" --> doShift "games" <> doCenterFloat <> hasBorder False, + className =? "diablo iv.exe" --> doShift "games" <> doCenterFloat <> hasBorder False, + className =? "obsidian" --> doShift "trash" <> hasBorder True, + className =? "libreoffice-writer" --> doShift "trash", + title =? "Wine System Tray" --> doHide, -- Prevents Wine System Trays from taking input focus. + className =?? "steam_" --> doShift "games" <> hasBorder False <> doCenterFloat + ] + +{- May be useful one day +doClose = ask >>= liftX . killWindow >> mempty :: ManageHook +doForceKill = ask >>= liftX . forceKillWindow >> mempty :: ManageHook +-} + +myEventHook :: Event -> X All +myEventHook _ = return (All True) + +myLayoutHook = + avoidStruts $ + lessBorders OnlyScreenFloat $ + spacingRaw False (Border w w w w) True (Border w w w w) True $ + focusTracking (tiled ||| Full) + where + tiled = Tall nmaster delta ratio + nmaster = 1 -- Default number of windows in the master pane. + ratio = 1 / 2 -- Default proportion of screen occupied by master panes. + delta = 3 / 100 -- Percent of screen increment by when resizing panes. + w = 2 -- Width of pixel size between windows while tiled. + +myXmobarPP :: X PP +myXmobarPP = + clickablePP $ + filterOutWsPP ["NSP"] $ + def + { ppCurrent = xmobarColor "#ece1d7" "" . xmobarBorder "Bottom" "#89b3b6" 3, + ppVisible = xmobarColor "#ece1d7" "", + ppHidden = xmobarColor "#c1a78e" "" . xmobarBorder "Top" "#f0c674" 2, + ppHiddenNoWindows = xmobarColor "#c1a78e" "", + -- { ppVisible = xmobarColor "#dddddd" "" . const "\xf10c", + -- ppCurrent = xmobarColor "#dddddd" "" . const "\xf192", + -- ppHidden = xmobarColor "#777777" "" . const "\xf10c", + -- ppHiddenNoWindows = xmobarColor "#444444" "" . const "\xf10c", + ppVisibleNoWindows = Just (xmobarBorder "Bottom" "#78997a" 2 . xmobarColor "#A0A0A0" ""), + -- ppVisibleNoWindows = Just (xmobarColor "#dddddd" "" . const "\xf10c"), + ppUrgent = xmobarColor "#D47786" "" . wrap "!" "!", + ppTitle = xmobarColor "#ece1d7" "" . shorten 40, + ppSep = wrapSep " ", + ppTitleSanitize = xmobarStrip, + ppWsSep = " ", + ppLayout = + xmobarColor "#002B36" "" + . ( \case + "Spacing Tall" -> "" + -- "Spacing Mirror Tall" -> "" + "Spacing Full" -> "" + -- "Spacing Simple Float" -> "" + -- "Simple Float" -> "" + ) + } + where + wrapSep :: String -> String + -- wrapSep = (++ xmobarColor "#002b36" "#002B36" (xmobarFont 2 "\xe0b4 ")) + wrapSep = (++ xmobarColor "#292522" "#292522" (xmobarFont 2 "\xe0b4 ")) + +-- wrap +-- (xmobarColor "#002B36" "#002B36" (xmobarFont 2 "\xe0b4")) +-- (xmobarColor "#002B36" "#002B36" (xmobarFont 2 "\xe0b6")) + +myXmobar :: String +myXmobar = (myHomeDir ++ "/.local/bin/xmobar " ++ "-x 1") + +xmobar :: StatusBarConfig +xmobar = statusBarProp myXmobar myXmobarPP + +myXmobar2 :: String +myXmobar2 = (myHomeDir ++ "/.local/bin/xmobar2 " ++ "-x 1") + +xmobar2 :: StatusBarConfig +xmobar2 = statusBarProp myXmobar2 myXmobarPP + +myConfig = + def + { modMask = myModMask, + focusFollowsMouse = myFocusFollowsMouse, + terminal = myTerminal, + mouseBindings = myMouseBindings, + borderWidth = myBorderWidth, + normalBorderColor = myNormColor, + focusedBorderColor = myFocusColor, + layoutHook = myLayoutHook, + startupHook = myStartupHook, + manageHook = myManageHook, + handleEventHook = + swallowEventHook (className =? "Alacritty" <||> className =? "kitty" <||> className =? "XTerm") (return True) + -- <> Hacks.windowedFullscreenFixEventHook -- #450 + <> Hacks.trayerPaddingXmobarEventHook + -- <> debugEventsHook + <> myEventHook, + workspaces = myWorkspaces, + keys = myKeys + } + `additionalKeysP` myAdditionalKeys + +myScratchpads = + [ NS "terminal" spawnTerm findTerm manageTerm, + NS "ncmpcpp" spawnncmpcpp findncmpcpp managencmpcpp + ] + where + spawnTerm = myTerminal ++ " --name scratchpad" + findTerm = resource =? "scratchpad" + manageTerm = customFloating $ W.RationalRect l t w h + where + h = 0.9 + w = 0.9 + t = 0.95 - h + l = 0.95 - w + spawnncmpcpp = myTerminal ++ " --name ncmpcpp -e ncmpcpp" + findncmpcpp = resource =? "ncmpcpp" + managencmpcpp = customFloating $ W.RationalRect l t w h + where + h = 0.9 + w = 0.9 + t = 0.95 - h + l = 0.95 - w + +-- I GIVE UP ON DBUS. + +-- logTitle :: D.Client -> X () +-- logTitle ch = dynamicLogWithPP def +-- {ppCurrent = unPango +-- ,ppVisible = pangoInactive +-- ,ppHidden = const "" +-- ,ppHiddenNoWindows = const "" +-- ,ppUrgent = pangoBold +-- ,ppTitle = unPango +-- ,ppLayout = unPango +-- ,ppWsSep = " " +-- ,ppSep = "⋮" +-- ,ppOrder = swapIcons +-- ,ppSort = getSortByXineramaPhysicalRule horizontalScreenOrderer +-- ,ppOutput = dbusOutput ch +-- } +-- where swapIcons (ws:l:t:nsp:xs) = ws:l:nsp:t:xs +-- -- @@@ so why do the first 4 invocations *only* not match?! +-- swapIcons xs = xs + +-- getWellKnownName :: D.Client -> IO () +-- getWellKnownName ch = do +-- _ <- D.requestName ch +-- (D.busName_ "org.xmonad.Log") +-- [D.nameAllowReplacement, D.nameReplaceExisting, D.nameDoNotQueue] +-- return () + +-- dbusOutput :: D.Client -> String -> IO () +-- dbusOutput ch s = do +-- let sig = (D.signal "/org/xmonad/Log" "org.xmonad.Log" "Update") +-- {D.signalBody = [D.toVariant s]} +-- D.emit ch sig + +-- -- quick and dirty escaping of HTMLish Pango markup +-- unPango :: String -> String +-- unPango [] = [] +-- unPango ('<':xs) = "<" ++ unPango xs +-- unPango ('&':xs) = "&" ++ unPango xs +-- unPango ('>':xs) = ">" ++ unPango xs +-- unPango (x :xs) = x:unPango xs + +-- -- show a string as inactive +-- -- @@@ should use gtk theme somehow... +-- pangoInactive :: String -> String +-- pangoInactive s = "" ++ unPango s ++ "" + +-- -- show a string with highlight +-- pangoBold :: String -> String +-- pangoBold s = "" ++ unPango s ++ "" diff --git a/configs/xmonad/package.yaml b/configs/xmonad/package.yaml index 8cd9072..0afe0df 100644 --- a/configs/xmonad/package.yaml +++ b/configs/xmonad/package.yaml @@ -12,6 +12,7 @@ ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-pattern dependencies: - base - xmonad-contrib >= 0.16 + - dbus source-dirs: src diff --git a/configs/xmonad/src/main-2.hs b/configs/xmonad/src/main-2.hs deleted file mode 100644 index 6b72235..0000000 --- a/configs/xmonad/src/main-2.hs +++ /dev/null @@ -1,12 +0,0 @@ -module Main (main) where - -import XMonad -import qualified XMonad.Util.Hacks as Hacks - -main :: IO () -main = - xmonad $ - fullscreenSupport - def - { handleEventHook = handleEventHook def <> Hacks.windowedFullscreenFixEventHook - } diff --git a/configs/xmonad/src/main.hs b/configs/xmonad/src/main.hs index 53059f9..4fe8627 100644 --- a/configs/xmonad/src/main.hs +++ b/configs/xmonad/src/main.hs @@ -21,6 +21,8 @@ import System.IO.Unsafe (unsafeDupablePerformIO) -- XMonad imports import XMonad import XMonad.Actions.NoBorders (toggleBorder) +import XMonad.Actions.ToggleFullFloat +import XMonad.Hooks.DebugEvents import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.ManageDebug import XMonad.Hooks.ManageDocks @@ -30,9 +32,9 @@ import XMonad.Hooks.StatusBar import XMonad.Hooks.StatusBar.PP import XMonad.Hooks.UrgencyHook (doAskUrgent) import XMonad.Hooks.WindowSwallowing +import XMonad.Layout.FocusTracking import XMonad.Layout.Fullscreen import XMonad.Layout.NoBorders -import XMonad.Layout.SimpleFloat import XMonad.Layout.Spacing import qualified XMonad.StackSet as W import XMonad.Util.ClickableWorkspaces @@ -53,17 +55,17 @@ main = $ debugManageHookOn "M-S-d" . docks . setEwmhActivateHook doAskUrgent - . ewmhFullscreen - -- . fullscreenSupport - . ewmh + -- . ewmhFullscreen -- breaks league of legends + . toggleFullFloatEwmhFullscreen + -- . fullscreenSupport -- breaks game launchers #450 + . ewmh -- modal dialogs #452 . Hacks.javaHack - . withEasySB xmobar toggleSB - . withSB xmobar2 + -- . withEasySB xmobar toggleSB + -- . withSB xmobar2 $ myConfig - where - toggleSB XConfig {modMask = modm} = (modm, xK_m) + -- where + -- toggleSB XConfig {modMask = modm} = (modm, xK_m) --- Windows key/Super key myModMask :: KeyMask myModMask = mod4Mask @@ -75,10 +77,6 @@ myTerminal = "kitty" myLauncher :: String myLauncher = myHomeDir ++ "/.config/rofi/launchers/type-6/launcher.sh" --- Default Launcher --- myWinSwitch :: String --- myWinSwitch = myHomeDir ++ "/.config/rofi/launchers/type-6/tab.sh" - -- Default Launcher myFileManager :: String -- myFileManager = "kitty -e ranger" @@ -86,7 +84,7 @@ myFileManager = "thunar" -- Default Browser myBrowser :: String -myBrowser = "brave-bin" +myBrowser = "firefox-bin" myPowerMenu :: String myPowerMenu = myHomeDir ++ "/.config/rofi/powermenu/type-6/powermenu.sh" @@ -94,7 +92,6 @@ myPowerMenu = myHomeDir ++ "/.config/rofi/powermenu/type-6/powermenu.sh" -- Workspaces myWorkspaces :: [String] myWorkspaces = ["term", "www", "comms", "games", "misc", "vm", "trash", "stm"] - -- myWorkspaces = map show [1 .. 9] -- Border Width @@ -107,7 +104,7 @@ myNormColor = "#383830" -- Focused Color myFocusColor :: String -myFocusColor = "#FF0000" +myFocusColor = "#cb4b16" -- Home Directory myHomeDir :: String @@ -124,7 +121,7 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)] ] ++ [ ((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f)) - | (key, sc) <- zip [xK_comma, xK_period, xK_z] [0 ..], + | (key, sc) <- zip [xK_comma, xK_period, xK_semicolon] [0 ..], (f, m) <- [(W.view, 0), (W.shift, shiftMask)] ] @@ -152,6 +149,9 @@ myAdditionalKeys = screenShotFullscreen = myHomeDir ++ "/.local/bin/print-fullscreen" :: String screenShotTmp = myHomeDir ++ "/.local/bin/print-tmp" :: String screenShotApp = myHomeDir ++ "/.local/bin/print-window.sh" :: String + myMainBrowser = myBrowser ++ " -p main" :: String + myDevBrowser = myBrowser ++ " -p dev" :: String + mySchoolBrowser = myBrowser ++ " -p school" :: String -- XMonad base keybinds. base = [ ("M-g", withFocused toggleBorder), @@ -178,7 +178,9 @@ myAdditionalKeys = ("M-h", sendMessage Shrink), ("M-l", sendMessage Expand), ("M-t", withFocused $ windows . W.sink), - ("M-f", withFocused toggleFull) + ("M-f", withFocused toggleFull), + ("M-C-S-6", withFocused $ \w -> spawn $ "xprop -id " ++ show w ++ " | ${XMONAD_XMESSAGE:-xmessage} -file -"), + ("M-S-f", withFocused toggleFullFloat) ] -- Spawning applications. applications = @@ -186,16 +188,20 @@ myAdditionalKeys = ("M-S-m", namedScratchpadAction myScratchpads "ncmpcpp"), ("M-C-", namedScratchpadAction myScratchpads "terminal"), ("M-S-", spawn myPowerMenu), - ("M-b", spawn myBrowser), + ("M-b", spawn myMainBrowser), + ("M-S-b", spawn myDevBrowser), + ("M-C-b", spawn mySchoolBrowser), ("M-v", spawn "code"), - ("M-S-s", spawn "~/steam/steam.sh"), + ("M-S-s", spawn "flatpak run com.valvesoftware.Steam --noverifyfiles"), ("S-", unGrab *> spawn screenShotSelection), ("C-S-", unGrab *> spawn screenShotTmp), ("C-", unGrab *> spawn screenShotApp), ("", spawn screenShotFullscreen), ("M-S-", spawn myLauncher), -- ("M1-", spawn myWinSwitch), - ("M-e", spawn myFileManager) + ("M-e", spawn myFileManager), + ("C-S-m", spawn "~/scripts/macro.sh"), + ("M-C-x", spawn "GTK_THEME=Orchis-Dark xournalpp") ] -- Multimedia keybinds. multimedia = @@ -224,27 +230,24 @@ myMouseBindings XConfig {XMonad.modMask = modm} = myStartupHook :: X () myStartupHook = do - _ <- - traverse - spawnOnce - [ "sh ~/scripts/screenlayout.sh", - -- "nitrogen --restore &", - "feh --bg-center ~/Pictures/wallpapers/felca.jpg", - -- "sh ~/scripts/wallpaper.sh", - "touch ~/tmp/touchy && rm -rf ~/tmp/*", - myHomeDir ++ "/.local/bin/picom-ibhagwan -b --experimental-backends &", - "nm-applet &", - "xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Profile Enabled' 0, 1 && xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Speed' 0.5", - "setxkbmap -option ctrl:nocaps br abnt2", - "trayer-srg --edge top --align right --SetDockType true --SetPartialStrut true --expand true --widthtype request --tint 0x2F2F2F --height 25 --distance 0 --margin 0 --alpha 0 --monitor 0 --transparent true", -- normal bar - -- "trayer-srg --edge bottom --align right --SetDockType true --SetPartialStrut true --expand true --widthtype request --tint 0x002b36 --height 30 --transparent false --distance 1 --margin 6 --alpha 0 --monitor 0 --transparent true", -- spaced bar - "dunst &", - "lxqt-policykit-agent &", - "xrdb -load ~/.Xresources", - "redshift -t 4500:2500 -l -23.5475:-46.63611" - ] + -- _ <- + -- traverse + -- spawnOnce + -- [ "sh ~/scripts/screenlayout.sh", + -- "feh --bg-center ~/Pictures/wallpapers/felca.jpg", + -- "touch ~/tmp/touchy && rm -rf ~/tmp/*", + -- myHomeDir ++ "/.local/bin/picom-ibhagwan -b --experimental-backends &", + -- "xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Profile Enabled' 0, 1 && xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Speed' 0.5", + -- "setxkbmap -option ctrl:nocaps br abnt2", + -- "trayer-srg --edge top --align right --SetDockType true --SetPartialStrut true --expand true --widthtype request --tint 0x2F2F2F --height 25 --distance 0 --margin 0 --alpha 0 --monitor 1 --transparent true", -- normal bar + -- -- "trayer-srg --edge bottom --align right --SetDockType true --SetPartialStrut true --expand true --widthtype request --tint 0x002b36 --height 30 --transparent false --distance 1 --margin 6 --alpha 0 --monitor 0 --transparent true", -- spaced bar + -- "dunst &", + -- "lxqt-policykit-agent &", + -- "xrdb -load ~/.Xresources", + -- -- "redshift -t 4500:2500 -l -23.5475:-46.63611" + -- ] setDefaultCursor xC_left_ptr - setWMName "zmonad" + setWMName "xfce+xmonad" isInstance (ClassApp c _) = className =? c isInstance (TitleApp t _) = title =? t @@ -331,29 +334,31 @@ myManageHook = manageRules className ^? "jetbrains-" <&&> title =? "splash" --> doFloat, className ^? "Visual " <&&> isDialog --> doCenterFloat, className =? "firefox-esr" --> doShift "www", - className =? "Chromium-browser-chromium" --> doShift "www", - className =? "Brave-browser" --> doShift "www", className =? "Virt-manager" --> doShift "vm", - className =? "discord" --> doShift "comms", - className =? "discord-screenaudio" --> doShift "comms", - className =? "Spotify" --> doShift "msc", - className =? "thunderbird" --> doShift "trash", + className =? "discord" --> doShift "misc", + className =? "discord-screenaudio" --> doShift "misc", className =? "Steam" --> doShift "stm", className =? "steam" --> doShift "stm", + className =? "steamwebhelper" --> doShift "stm", className =? "obs" --> doShift "misc", className =? "Lutris" --> doShift "misc", + className =? "PrismLauncher" --> doShift "misc", className =? "explorer.exe" --> doShift "games", + className =? "starrail.exe" --> doShift "games", className =? "An Anime Game Launcher" --> doShift "misc" <> doCenterFloat <> hasBorder False, - className =? "heroic" --> doShift "misc" <> doCenterFloat <> hasBorder False, + className =? "heroic" --> doShift "misc" <> hasBorder False, + className =? "parsecd" --> doShift "misc" <> hasBorder False, className =? "riotclientux.exe" --> doShift "games", className =?? "dauntless" --> doShift "games", className =? "battle.net.exe" --> doShift "games" <> doFloat, className =? "Pcmanfm" --> doFloat, + className =? "Mousepad" --> doFloat, className =? "Thunar" --> doFloat, + className =? "amberol" --> doFloat, className =? "Pavucontrol" --> doFloat, className =? "Nitrogen" --> doFloat, className =? "Wrapper-2.0" --> doFloat, - className =? "TeamSpeak 3" --> doShift "comms", + className =? "TeamSpeak 3" --> doShift "misc", className =? "easyeffects" --> doFloat <> doShift "misc", className =? "Arandr" --> doFloat, resource =? "desktop_window" --> doIgnore, @@ -364,12 +369,18 @@ myManageHook = manageRules -- Steam Game Fixes className =? "steam_app_1551360" <&&> title /=? "Forza Horizon 5" --> doHide, -- Prevents black screen when fullscreening. className =? "Steam" <&&> title ~? "News" --> doHide, + className =? "Xfce4-panel" --> doCenterFloat <> hasBorder False, className =?? "league" --> doShift "games" <> doCenterFloat <> hasBorder False, className =?? "deceive" --> doShift "games" <> doCenterFloat <> hasBorder False, className =?? "riot" --> doShift "games" <> doCenterFloat <> hasBorder False, className =?? "Minecraft" --> doShift "games" <> doCenterFloat <> hasBorder False, className =?? "csgo" --> doShift "games" <> doCenterFloat <> hasBorder False, className =? "gamescope" --> doShift "games" <> doCenterFloat <> hasBorder False, + className =? "diablo iv.exe" --> doShift "games" <> doCenterFloat <> hasBorder False, + className =? "Transformice" --> doShift "games", + className =? "obsidian" --> doShift "games", + className =? "Xournalpp" --> doShift "games", + className =?? "libreoffice" --> doShift "games", title =? "Wine System Tray" --> doHide, -- Prevents Wine System Trays from taking input focus. className =?? "steam_" --> doShift "games" <> hasBorder False <> doCenterFloat ] @@ -382,15 +393,11 @@ doForceKill = ask >>= liftX . forceKillWindow >> mempty :: ManageHook myEventHook :: Event -> X All myEventHook _ = return (All True) --- myActivateHook :: ManageHook --- myActivateHook = composeAll --- [ className =? "steam_app_1284210" --> doAskUrgent ] - myLayoutHook = avoidStruts $ lessBorders OnlyScreenFloat $ spacingRaw False (Border w w w w) True (Border w w w w) True $ - tiled ||| simpleFloat ||| Mirror tiled ||| Full + focusTracking (tiled ||| Full) where tiled = Tall nmaster delta ratio nmaster = 1 -- Default number of windows in the master pane. @@ -422,10 +429,10 @@ myXmobarPP = xmobarColor "#002B36" "" . ( \case "Spacing Tall" -> "" - "Spacing Mirror Tall" -> "" + -- "Spacing Mirror Tall" -> "" "Spacing Full" -> "" - "Spacing Simple Float" -> "" - "Simple Float" -> "" + -- "Spacing Simple Float" -> "" + -- "Simple Float" -> "" ) } where @@ -438,7 +445,7 @@ myXmobarPP = -- (xmobarColor "#002B36" "#002B36" (xmobarFont 2 "\xe0b6")) myXmobar :: String -myXmobar = (myHomeDir ++ "/.local/bin/xmobar " ++ "-x 0") +myXmobar = (myHomeDir ++ "/.local/bin/xmobar " ++ "-x 1") xmobar :: StatusBarConfig xmobar = statusBarProp myXmobar myXmobarPP @@ -462,9 +469,10 @@ myConfig = startupHook = myStartupHook, manageHook = myManageHook, handleEventHook = - -- Hacks.windowedFullscreenFixEventHook swallowEventHook (className =? "Alacritty" <||> className =? "kitty" <||> className =? "XTerm") (return True) + -- <> Hacks.windowedFullscreenFixEventHook -- #450 <> Hacks.trayerPaddingXmobarEventHook + -- <> debugEventsHook <> myEventHook, workspaces = myWorkspaces, keys = myKeys diff --git a/configs/xmonad/src/melange1.hs b/configs/xmonad/src/melange1.hs index 5659c21..0432543 100644 --- a/configs/xmonad/src/melange1.hs +++ b/configs/xmonad/src/melange1.hs @@ -5,8 +5,6 @@ import Xmobar main :: IO () main = xmobar =<< configFromArgs =<< myConfig --- main = xmobar =<< myConfig - myHomeDir :: String myHomeDir = unsafeDupablePerformIO (getEnv "HOME") diff --git a/configs/xmonad/stack.yaml b/configs/xmonad/stack.yaml index 30d3c22..181bafd 100644 --- a/configs/xmonad/stack.yaml +++ b/configs/xmonad/stack.yaml @@ -15,7 +15,6 @@ extra-deps: - pango-0.13.8.2@sha256:d4057ebddade4cde3e25d7755b5e030e7a7e56fe7365afd37916a7bba46d3fd9,3917 - glib-0.13.8.2@sha256:f44b829e741b3c3244d523f60b058701dfc067ff64c2ba61d43be4cccfc2663d,3156 - flags: xmobar: with_xpm: true diff --git a/configs/xmonad/zmonad.cabal b/configs/xmonad/zmonad.cabal index 11563da..792b295 100644 --- a/configs/xmonad/zmonad.cabal +++ b/configs/xmonad/zmonad.cabal @@ -1,6 +1,9 @@ --- heavily copied from github.com/scherso, all rights to him cabal-version: 1.12 +-- This file has been generated from package.yaml by hpack version 0.35.0. +-- +-- see: https://github.com/sol/hpack + name: zmonad version: 0.1.0 synopsis: xmonad but z @@ -19,10 +22,9 @@ executable xmobar ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -O2 -j -dynamic -rtsopts -threaded -with-rtsopts=-N build-depends: base + , dbus , xmobar , xmonad-contrib >=0.16 - , cairo >=0.13 - , pango >=0.13 default-language: Haskell2010 executable xmobar2 @@ -34,10 +36,9 @@ executable xmobar2 ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -O2 -j -dynamic -rtsopts -threaded -with-rtsopts=-N build-depends: base + , dbus , xmobar , xmonad-contrib >=0.16 - , cairo >=0.13 - , pango >=0.13 default-language: Haskell2010 executable xmonad @@ -51,6 +52,7 @@ executable xmonad X11 >=1.10 , base , containers + , dbus , xmonad , xmonad-contrib >=0.16 default-language: Haskell2010 diff --git a/configs/zshrc b/configs/zshrc index bcb5692..4ae5051 100644 --- a/configs/zshrc +++ b/configs/zshrc @@ -4,19 +4,28 @@ export PATH="$HOME/.local/bin:$PATH" # Path to your oh-my-zsh installation. export ZSH="$HOME/.oh-my-zsh" +export PATH="$HOME/.npm-global/bin:$PATH" +export R2MOD_INSTALL_DIR="$HOME/steam/.local/share/Steam/steamapps/common/Risk of Rain 2/" +export R2MOD_COMPAT_DIR="$HOME/steam/.local/share/Steam/steamapps/compatdata/632360" -export EDITOR="/usr/bin/nvim" -export EDITOR=nvim -export VISUAL=nvim +export EDITOR="/usr/bin/nvim" +export VISUAL="nvim" # Set name of the theme to load --- if set to "random", it will # load a random theme each time oh-my-zsh is loaded, in which case, # to know which specific one was loaded, run: echo $RANDOM_THEME # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes #ZSH_THEME="jnrowe" -ZSH_THEME="headline" -#fpath+=$HOME/.zsh/typewritten -#autoload -U promptinit; promptinit -#prompt typewritten +#ZSH_THEME="headline" +ZSH_THEME="" +fpath+=$HOME/Documents/typewritten +fpath+=$HOME/.config/zsh +autoload -Uz async && async +autoload -U promptinit; promptinit +prompt typewritten +export TYPEWRITTEN_PROMPT_LAYOUT="half_pure" +export TYPEWRITTEN_RELATIVE_PATH="git" +export TYPEWRITTEN_COLOR_MAPPINGS="primary:yellow" +# export TYPEWRITTEN_LEFT_PROMPT_PREFIX_FUNCTION=(date +%H:%M) # Set list of themes to pick from when loading at random # Setting this variable when ZSH_THEME=random will cause zsh to load # a theme from this variable instead of looking in $ZSH/themes/ @@ -31,9 +40,9 @@ ZSH_THEME="headline" # HYPHEN_INSENSITIVE="true" # Uncomment one of the following lines to change the auto-update behavior -# zstyle ':omz:update' mode disabled # disable automatic updates +zstyle ':omz:update' mode disabled # disable automatic updates # zstyle ':omz:update' mode auto # update automatically without asking -# zstyle ':omz:update' mode reminder # just remind me to update when it's time +zstyle ':omz:update' mode reminder # just remind me to update when it's time # Uncomment the following line to change how often to auto-update (in days). # zstyle ':omz:update' frequency 13 @@ -59,7 +68,7 @@ ZSH_THEME="headline" # Uncomment the following line if you want to disable marking untracked files # under VCS as dirty. This makes repository status check for large repositories # much, much faster. -# DISABLE_UNTRACKED_FILES_DIRTY="true" +DISABLE_UNTRACKED_FILES_DIRTY="true" # Uncomment the following line if you want to change the command execution time # stamp shown in the history command output. @@ -78,9 +87,11 @@ ZSH_THEME="headline" # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. plugins=( - git - zsh-autosuggestions - zsh-syntax-highlighting + git + zsh-autosuggestions + fast-syntax-highlighting + rust + nvm ) source $ZSH/oh-my-zsh.sh @@ -93,23 +104,25 @@ source $ZSH/oh-my-zsh.sh # export LANG=en_US.UTF-8 # Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -# export EDITOR='vim' -# else -# export EDITOR='mvim' -# fi +if [[ -n $SSH_CONNECTION ]]; then + export EDITOR='vim' +else + export EDITOR='nvim' +fi # Compilation flags # export ARCHFLAGS="-arch x86_64" # # # Adding LS COLORS VARIABLE -cd -export LS_COLORS="$(vivid generate iceberg-dark)" +# export LS_COLORS="$(vivid generate solarized-dark)" + +ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#67828c,bold,underline" #Adding Doom Emacs to PATH export PATH="$HOME/.emacs.d/bin:$PATH" +[ -f "/home/jab/.ghcup/env" ] && source "/home/jab/.ghcup/env" # ghcup-env # Adding XDG compliance export XDG_DATA_HOME=$HOME/.local/share @@ -125,15 +138,15 @@ export XDG_CACHE_HOME=$HOME/.cache #export NODE_REPL_HISTORY="$XDG_DATA_HOME"/node_repl_history #alias nvidia-settings --config="$XDG_CONFIG_HOME"/nvidia/settings #export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java +# +# GPG shenanigans +export GPG_TTY=$(tty) # Add cargo/bin to PATH -export PATH=/home/lucas/.cargo/bin:$PATH +export PATH="$HOME/.cargo/bin:$PATH" -# Add spicetify to path -export PATH=$PATH:/home/lucas/.spicetify - -if [[ "${TERM}" != "" && "${TERM}" == "alacritty" ]] +if [[ "${TERM}" != "" && "${TERM}" == "kitty" ]] then precmd() { @@ -151,25 +164,32 @@ then } fi +function 0x0.st () { + local CMD="curl -F'file=@-' https://0x0.st" + if [ ! -t 0 ]; then + cat | eval $CMD + else + for i in "$@"; do + cat "$i" + done | eval $CMD + fi +} + +export BAT_THEME="Solarized (dark)" -## Aliases -alias xmorc="xmonad --recompile; xmonad --restart" -alias xmonadc="nvim ~/.config/xmonad/xmonad.hs" -alias xmobarc="nvim ~/.config/xmobar/xmobarrc" -alias nano="nvim" -alias ls="lsd --group-dirs first" + +alias ls="exa --numeric --octal-permissions --git --group --icons" +alias l="exa --all --long --numeric --octal-permissions --git --group --icons" alias cat="bat" -alias config='/usr/bin/git --git-dir=$HOME/dotfiles/ --work-tree=$HOME' alias v="nvim" -alias vim=nvim -#alias sudo="doas" -#alias clear="clear && fortune | cowsay | lolcat" alias c="clear" -alias music='tmux new-session "tmux source-file ~/.ncmpcpp/tmux_session"' # Tmux session with ncmpcpp and cover art - -#fm6000 -c yellow -f bass.txt -o Artix -n -m 5 -g 5 -l 15 -#sh ~/Docs/pfetch/pfetch -#neofetch --config ~/.config/neofetch/config2.conf -nitch -fortune | cowsay +alias hi="systemctl hibernate" +alias nitch="cd ~/Documents/nitch/ && ./nitch && cd -" +alias sx="startx" +alias irc="ssh server -t tmux -L weechat attach" +alias server="ssh server -t tmux -L minecraft attach" +alias kitsune="cd ~/repos/kitsune/" +[ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh" +cd +unsetopt BEEP diff --git a/kitty/kitty.conf b/kitty/kitty.conf new file mode 100644 index 0000000..90f8a5d --- /dev/null +++ b/kitty/kitty.conf @@ -0,0 +1,154 @@ +################################## +############# FONTS ############## +################################## + +font_family Cartograph CF Demi Bold +italic_font Cartograph CF Italic +bold_font Cartograph CF Bold +bold_italic_font Cartograph CF Bold Italic + +font_size 12.8 + +#foreground #FFFFFF +#background #060609 + +#selection_foreground #000000 +#selection_background #dddddd + +adjust_line_height 110% + +################################## +############# CURSOR ############# +################################## + +cursor #FFFFFF +cursor_shape beam +shell_integration no-cursor +select_by_word_characters : @-./_~?&=%+# +repaint_delay 10 +term xterm-kitty +open_url_with default +scrollback_lines 10000 +cursor_blink_interval 0 + + +################################## +############# BORDER ############# +################################## + +window_border_width 8 +window_margin_width 8 +active_border_color #ffffff +inactive_border_color #cccccc +background_opacity 0.85 +# window settings +remember_window_size yes +initial_window_width 135c +initial_window_height 35c + +################################## +############# COLORS ############# +################################## +# background #fdf6e3 +# foreground #52676f +# cursor #52676f +# selection_background #e9e2cb +# color0 #e4e4e4 +# color8 #ffffd7 +# color1 #d70000 +# color9 #d75f00 +# color2 #5f8700 +# color10 #585858 +# color3 #af8700 +# color11 #626262 +# color4 #0087ff +# color12 #808080 +# color5 #af005f +# color13 #5f5faf +# color6 #00afaf +# color14 #8a8a8a +# color7 #262626 +# color15 #1c1c1c +selection_foreground #fcf4dc +background #001e26 +foreground #708183 +cursor #708183 +selection_background #002731 +color0 #002731 +color8 #465a61 +color1 #d01b24 +color9 #bd3612 +color2 #728905 +color10 #465a61 +color3 #a57705 +color11 #52676f +color4 #2075c7 +color12 #708183 +color5 #c61b6e +color13 #5856b9 +color6 #259185 +color14 #81908f +color7 #e9e2cb +color15 #fcf4dc +# selection_foreground #001e26 +# +# foreground #D8DEE9 +# background #2E3440 +# selection_foreground #000000 +# selection_background #FFFACD +# url_color #0087BD +# cursor #81A1C1 +# color0 #3B4252 +# color8 #4C566A +# color1 #BF616A +# color9 #BF616A +# color2 #A3BE8C +# color10 #A3BE8C +# color3 #EBCB8B +# color11 #EBCB8B +# color4 #81A1C1 +# color12 #81A1C1 +# color5 #B48EAD +# color13 #B48EAD +# color6 #88C0D0 +# color14 #8FBCBB +# color7 #E5E9F0 +# color15 #ECEFF4 + +# melange +# background #292522 +# foreground #ECE1D7 +# cursor #867462 +# color0 #34302C +# color1 #BD8183 +# color2 #78997A +# color3 #E49B5D +# color4 #7F91B2 +# color5 #B380B0 +# color6 #7B9695 +# color7 #C1A78E +# color8 #867462 +# color9 #D47766 +# color10 #85B695 +# color11 #EBC06D +# color12 #A3A9CE +# color14 #CF9BC2 +# color14 #89B3B6 +# color15 #422741 + + +################################## +########## KEY BINDINGS ########## +################################## + +map ctrl+l clear_log_notice + +map shift+up scroll_line_up +map shift+down scroll_line_down +map shift+page_up scroll_page_up +map shift+page_down scroll_page_down +map ctrl+shift+home scroll_home +map ctrl+shift+end scroll_end + +map ctrl+equal increase_font_size +map ctrl+minus decrease_font_size diff --git a/kitty/undefined.conf b/kitty/undefined.conf new file mode 100644 index 0000000..d6980d5 --- /dev/null +++ b/kitty/undefined.conf @@ -0,0 +1,91 @@ +################################## +############# FONTS ############## +################################## + +font_family NotoSansMono Nerd Font +italic_font NotoSansMono Nerd Font +bold_font NotoSansMono Nerd Font +bold_italic_font NotoSansMono Nerd Font + +font_size 12.0 + +#foreground #FFFFFF +#background #060609 + +#selection_foreground #000000 +#selection_background #dddddd + +adjust_line_height 110% + +################################## +############# CURSOR ############# +################################## + +cursor #FFFFFF +cursor_shape beam +shell_integration no-cursor +select_by_word_characters : @-./_~?&=%+# +repaint_delay 10 +term xterm-kitty +open_url_with default +scrollback_lines 10000 +cursor_blink_interval 0 + + +################################## +############# BORDER ############# +################################## + +window_border_width 8 +window_margin_width 8 +active_border_color #ffffff +inactive_border_color #cccccc +background_opacity 0.90 +# window settings +remember_window_size no +initial_window_width 135c +initial_window_height 35c + +################################## +############# COLORS ############# +################################## +background #0c1115 +background #000000 +foreground #ffffff +cursor #6c6c6c +selection_background #bd2523 +color0 #2e343c +color8 #404a55 +color1 #bd0f2f +color9 #bd0f2f +color2 #35a770 +color10 #49e998 +color3 #fb9435 +color11 #fddf6e +color4 #1f5872 +color12 #2a8bc1 +color5 #bd2523 +color13 #ea4727 +color6 #778397 +color14 #a0b6d3 +color7 #ffffff +color15 #ffffff +selection_foreground #0c1115 + + + +################################## +########## KEY BINDINGS ########## +################################## + +map ctrl+l clear_log_notice + +map shift+up scroll_line_up +map shift+down scroll_line_down +map shift+page_up scroll_page_up +map shift+page_down scroll_page_down +map ctrl+shift+home scroll_home +map ctrl+shift+end scroll_end + +map ctrl+equal increase_font_size +map ctrl+minus decrease_font_size diff --git a/mozilla/userChrome.css b/mozilla/userChrome.css new file mode 100644 index 0000000..c16a3e9 --- /dev/null +++ b/mozilla/userChrome.css @@ -0,0 +1,93 @@ +/* hide tabs */ +#TabsToolbar { +visibility: hidden; +height: 0px; +} +/* hide titlebar (ff113) */ +#titlebar { + display: none; +} + +/* smaller sideberry badge */ +#sidebar-switcher-target { +transform: scale(0.6); +position: relative; +left: -24px; +} +#sidebar-header { + height: 24px; + background-color: black; +} + +/* navbar on the bottom (might break? inverts the layout of root) */ +/* TODO: fixme: show search results +body { +-moz-box-direction: reverse !important; + } +*/ +#navigator-toolbox { + border: none !important; +} + +/* urlbar not round, no border, spans the entire navbar height */ +#urlbar-container { +padding: 0 !important; +} +#urlbar-background, #searchbar { + border: none !important; + border-radius: 0 !important; +} +#urlbar-background { + min-height: 50px; + top: -8px; +} + +#urlbar[focused="true"]:not([suppress-focus-border]) > #urlbar-background, #searchbar:focus-within { +outline: none !important; +} + +/* remove sidebar splitter next to sideberry */ +.sidebar-splitter { +/* display: none !important; */ +width: 2px !important; +} + +/* NOTE: forces pinned extentions into the extention menu? */ +/* hides back and forwards arrows if not active NOTE: disable rule if reordering taskbar +.toolbarbutton-1[disabled="true"] { + visibility: collapse; +} */ + +#sidebar-close { + display: none !important; +} + +/* smaller bookmark items */ + +.bookmark-item, [data-l10n-id="places-open-all-bookmarks"], [data-l10n-id="places-open-all-in-tabs"], [data-l10n-id="places-open-in-container-tab"], .openintabs-menuitem { /* useless/undesired selectors? */ + font-size: 12px !important; +} + +.bookmark-item image { + width: 12px !important; + height: 12px !important; +} + +#PlacesChevron { /* stretches toolbar if visible otherwise */ + height: 18px !important; +} + +menuitem.bookmark-item, .bookmark-item, image .openintabs-menuitem { /* NOTE: .bookmark-item targets wrapped folders */ + margin: 2px !important; + padding: 2px !important; + padding-left: 6px !important; /* looks less wrong */ + min-height: 12px !important; +} + +/* self-described */ +.bookmarks-actions-menuseparator { + visibility: hidden !important; + height: 4px !important; + padding-top: 0 !important; + padding-bottom: 0 !important; +}