diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-07-22 00:08:36 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-07-22 00:08:36 +0200 |
commit | b51f1ae28924a752258e7607fbc3210f9b18eaac (patch) | |
tree | 8c8c095528990b3f6eb499dbcca15e9720e636d1 /.config/nvim/lua/cfg | |
parent | da936b0ed9ac4c171d3c7908e41af1875a82b08b (diff) |
Updates based on Chris's lunarvim
Diffstat (limited to '.config/nvim/lua/cfg')
23 files changed, 0 insertions, 1986 deletions
diff --git a/.config/nvim/lua/cfg/autopairs/init.lua b/.config/nvim/lua/cfg/autopairs/init.lua deleted file mode 100644 index b8dad5f..0000000 --- a/.config/nvim/lua/cfg/autopairs/init.lua +++ /dev/null @@ -1,51 +0,0 @@ --- if not package.loaded['nvim-autopairs'] then --- return --- end -local status_ok, autopairs = pcall(require, "nvim-autopairs") -if not status_ok then - return -end -local npairs = require "nvim-autopairs" -local Rule = require "nvim-autopairs.rule" - --- skip it, if you use another global object -_G.MUtils = {} - -vim.g.completion_confirm_key = "" -MUtils.completion_confirm = function() - if vim.fn.pumvisible() ~= 0 then - if vim.fn.complete_info()["selected"] ~= -1 then - return vim.fn["compe#confirm"](npairs.esc "<cr>") - else - return npairs.esc "<cr>" - end - else - return npairs.autopairs_cr() - end -end - -if package.loaded["compe"] then - require("nvim-autopairs.completion.compe").setup { - map_cr = true, -- map <CR> on insert mode - map_complete = true, -- it will auto insert `(` after select function or method item - } -end - -npairs.setup { - check_ts = true, - ts_config = { - lua = { "string" }, -- it will not add pair on that treesitter node - javascript = { "template_string" }, - java = false, -- don't check treesitter on java - }, -} - -require("nvim-treesitter.configs").setup { autopairs = { enable = true } } - -local ts_conds = require "nvim-autopairs.ts-conds" - --- press % => %% is only inside comment or string -npairs.add_rules { - Rule("%", "%", "lua"):with_pair(ts_conds.is_ts_node { "string", "comment" }), - Rule("$", "$", "lua"):with_pair(ts_conds.is_not_ts_node { "function" }), -} diff --git a/.config/nvim/lua/cfg/barbar/init.lua b/.config/nvim/lua/cfg/barbar/init.lua deleted file mode 100644 index 5257de5..0000000 --- a/.config/nvim/lua/cfg/barbar/init.lua +++ /dev/null @@ -1,27 +0,0 @@ -vim.api.nvim_set_keymap("n", "<TAB>", ":BufferNext<CR>", { noremap = true, silent = true }) -vim.api.nvim_set_keymap("n", "<S-TAB>", ":BufferPrevious<CR>", { noremap = true, silent = true }) -vim.api.nvim_set_keymap("n", "<S-x>", ":BufferClose<CR>", { noremap = true, silent = true }) - -O.user_which_key["b"] = { - name = "Buffers", - j = { "<cmd>BufferPick<cr>", "jump to buffer" }, - f = { "<cmd>Telescope buffers<cr>", "Find buffer" }, - w = { "<cmd>BufferWipeout<cr>", "wipeout buffer" }, - e = { - "<cmd>BufferCloseAllButCurrent<cr>", - "close all but current buffer", - }, - h = { "<cmd>BufferCloseBuffersLeft<cr>", "close all buffers to the left" }, - l = { - "<cmd>BufferCloseBuffersRight<cr>", - "close all BufferLines to the right", - }, - D = { - "<cmd>BufferOrderByDirectory<cr>", - "sort BufferLines automatically by directory", - }, - L = { - "<cmd>BufferOrderByLanguage<cr>", - "sort BufferLines automatically by language", - }, -} diff --git a/.config/nvim/lua/cfg/colorizer/init.lua b/.config/nvim/lua/cfg/colorizer/init.lua deleted file mode 100644 index abe2f72..0000000 --- a/.config/nvim/lua/cfg/colorizer/init.lua +++ /dev/null @@ -1,14 +0,0 @@ -local status_ok, colorizer = pcall(require, "colorizer") -if not status_ok then - return -end -colorizer.setup({ "*" }, { - RGB = true, -- #RGB hex codes - RRGGBB = true, -- #RRGGBB hex codes - RRGGBBAA = true, -- #RRGGBBAA hex codes - rgb_fn = true, -- CSS rgb() and rgba() functions - hsl_fn = true, -- CSS hsl() and hsla() functions - css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB - css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn -}) --- names = true; -- "Name" codes like Blue diff --git a/.config/nvim/lua/cfg/compe/init.lua b/.config/nvim/lua/cfg/compe/init.lua deleted file mode 100644 index f42e8ad..0000000 --- a/.config/nvim/lua/cfg/compe/init.lua +++ /dev/null @@ -1,99 +0,0 @@ ---if not package.loaded['compe'] then --- return --- end - -local M = {} - -vim.g.vsnip_snippet_dir = O.vnsip_dir - -M.config = function() - local opt = { - enabled = O.auto_complete, - autocomplete = true, - debug = false, - min_length = 1, - preselect = "enable", - throttle_time = 80, - source_timeout = 200, - incomplete_delay = 400, - max_abbr_width = 100, - max_kind_width = 100, - max_menu_width = 100, - documentation = true, - - source = { - path = { kind = " (Path)" }, - buffer = { kind = " (Buffer)" }, - calc = { kind = " (Calc)" }, - vsnip = { kind = " (Snippet)" }, - nvim_lsp = { kind = " (LSP)" }, - -- nvim_lua = {kind = " "}, - nvim_lua = false, - spell = { kind = " (Spell)" }, - tags = false, - -- vim_dadbod_completion = true, - -- snippets_nvim = {kind = " "}, - -- ultisnips = {kind = " "}, - -- treesitter = {kind = " "}, - emoji = { kind = " ﲃ (Emoji)", filetypes = { "markdown", "text" } }, - -- for emoji press : (idk if that in compe tho) - }, - } - local status_ok, compe = pcall(require, "compe") - if not status_ok then - return - end - - compe.setup(opt) - - local t = function(str) - return vim.api.nvim_replace_termcodes(str, true, true, true) - end - - local check_back_space = function() - local col = vim.fn.col "." - 1 - if col == 0 or vim.fn.getline("."):sub(col, col):match "%s" then - return true - else - return false - end - end - - -- Use (s-)tab to: - --- move to prev/next item in completion menuone - --- jump to prev/next snippet's placeholder - _G.tab_complete = function() - if vim.fn.pumvisible() == 1 then - return t "<C-n>" - elseif vim.fn.call("vsnip#available", { 1 }) == 1 then - return t "<Plug>(vsnip-expand-or-jump)" - elseif check_back_space() then - return t "<Tab>" - else - return vim.fn["compe#complete"]() - end - end - - _G.s_tab_complete = function() - if vim.fn.pumvisible() == 1 then - return t "<C-p>" - elseif vim.fn.call("vsnip#jumpable", { -1 }) == 1 then - return t "<Plug>(vsnip-jump-prev)" - else - return t "<S-Tab>" - end - end - - vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", { expr = true }) - vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", { expr = true }) - vim.api.nvim_set_keymap("i", "<S-Tab>", "v:lua.s_tab_complete()", { expr = true }) - vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", { expr = true }) - - vim.api.nvim_set_keymap("i", "<C-Space>", "compe#complete()", { noremap = true, silent = true, expr = true }) - vim.api.nvim_set_keymap("i", "<CR>", "compe#confirm('<CR>')", { noremap = true, silent = true, expr = true }) - vim.api.nvim_set_keymap("i", "<C-e>", "compe#close('<C-e>')", { noremap = true, silent = true, expr = true }) - vim.api.nvim_set_keymap("i", "<C-f>", "compe#scroll({ 'delta': +4 })", { noremap = true, silent = true, expr = true }) - vim.api.nvim_set_keymap("i", "<C-d>", "compe#scroll({ 'delta': -4 })", { noremap = true, silent = true, expr = true }) -end - -return M diff --git a/.config/nvim/lua/cfg/dashboard/init.lua b/.config/nvim/lua/cfg/dashboard/init.lua deleted file mode 100644 index 770bb5a..0000000 --- a/.config/nvim/lua/cfg/dashboard/init.lua +++ /dev/null @@ -1,70 +0,0 @@ -local M = {} - -M.config = function() - vim.g.dashboard_disable_at_vimenter = 0 - - vim.g.dashboard_custom_header = O.dashboard.custom_header - - vim.g.dashboard_default_executive = "telescope" - - vim.g.dashboard_custom_section = { - a = { - description = { " Find File " }, - command = "Telescope find_files", - }, - b = { - description = { " Recently Used Files" }, - command = "Telescope oldfiles", - }, - -- c = { - -- description = { " Load Last Session " }, - -- command = "SessionLoad", - -- }, - c = { - description = { " Find Word " }, - command = "Telescope live_grep", - }, - d = { - description = { " Settings " }, - command = ":e " .. CONFIG_PATH .. "/config.lua", - }, - -- f = { - -- description = { " Neovim Config Files" }, - -- command = "Telescope find_files cwd=" .. CONFIG_PATH, - -- }, - -- e = {description = {' Marks '}, command = 'Telescope marks'} - } - vim.cmd "let g:dashboard_session_directory = $HOME..'/.config/nvim/.sessions'" - vim.cmd "let packages = len(globpath('~/.local/share/nvim/site/pack/packer/start', '*', 0, 1))" - - vim.api.nvim_exec( - [[ - let g:dashboard_custom_footer = ['LuaJIT loaded '..packages..' plugins'] -]], - false - ) - - -- file_browser = {description = {' File Browser'}, command = 'Telescope find_files'}, - - -- vim.g.dashboard_session_directory = CACHE_PATH..'/session' - -- vim.g.dashboard_custom_footer = O.dashboard.footer -end - -require("cfg.utils").define_augroups { - _dashboard = { - -- seems to be nobuflisted that makes my stuff disapear will do more testing - { - "FileType", - "dashboard", - "setlocal nocursorline noswapfile synmaxcol& signcolumn=no norelativenumber nocursorcolumn nospell nolist nonumber bufhidden=wipe colorcolumn= foldcolumn=0 matchpairs= ", - }, - { - "FileType", - "dashboard", - "set showtabline=0 | autocmd BufLeave <buffer> set showtabline=2", - }, - { "FileType", "dashboard", "nnoremap <silent> <buffer> q :q<CR>" }, - }, -} - -return M diff --git a/.config/nvim/lua/cfg/galaxyline/init.lua b/.config/nvim/lua/cfg/galaxyline/init.lua deleted file mode 100644 index c4bc5ef..0000000 --- a/.config/nvim/lua/cfg/galaxyline/init.lua +++ /dev/null @@ -1,333 +0,0 @@ --- if not package.loaded['galaxyline'] then --- return --- end -local status_ok, gl = pcall(require, "galaxyline") -if not status_ok then - return -end --- get my theme in galaxyline repo --- local colors = require('galaxyline.theme').default -local colors = { - bg = "#0A0A0A", - fg = "#D0D0D0", - yellow = "#DCDCAA", - dark_yellow = "#D7BA7D", - cyan = "#4EC9B0", - green = "#608B4E", - light_green = "#B5CEA8", - string_orange = "#CE9178", - orange = "#FF8800", - purple = "#C586C0", - magenta = "#D16D9E", - grey = "#858585", - blue = "#569CD6", - vivid_blue = "#4FC1FF", - light_blue = "#9CDCFE", - red = "#D16969", - error_red = "#F44747", - info_yellow = "#FFCC66", -} - -local condition = require "galaxyline.condition" -local gls = gl.section -gl.short_line_list = { "NvimTree", "vista", "dbui", "packer" } - -table.insert(gls.left, { - ViMode = { - provider = function() - local alias = { - n = 'NORMAL', - i = 'INSERT', - c = 'COMMAND', - V = 'VISUAL', - [''] = 'VISUAL', - v = 'VISUAL', - R = 'REPLACE', - } - local alias_mode = alias[vim.fn.mode()] - if alias_mode == nil then - alias_mode = vim.fn.mode() - end - return alias_mode..' ' - end, - separator_highlight = "StatusLineSeparator", - highlight = "StatusLineNC", - }, -}) - -vim.fn.getbufvar(0, "ts") - -table.insert(gls.left, { - GitIcon = { - provider = function() - return " " - end, - condition = condition.check_git_workspace, - separator = " ", - separator_highlight = "StatusLineSeparator", - highlight = "StatusLineGit", - }, -}) - -table.insert(gls.left, { - GitBranch = { - provider = "GitBranch", - condition = condition.check_git_workspace, - separator = " ", - separator_highlight = "StatusLineSeparator", - highlight = "StatusLineNC", - }, -}) - -table.insert(gls.left, { - DiffAdd = { - provider = "DiffAdd", - condition = condition.hide_in_width, - icon = " ", - highlight = "StatusLineGitAdd", - }, -}) - -table.insert(gls.left, { - DiffModified = { - provider = "DiffModified", - condition = condition.hide_in_width, - icon = " 柳", - highlight = "StatusLineGitChange", - }, -}) - -table.insert(gls.left, { - DiffRemove = { - provider = "DiffRemove", - condition = condition.hide_in_width, - icon = " ", - highlight = "StatusLineGitDelete", - }, -}) - -table.insert(gls.left, { - Filler = { - provider = function() - return " " - end, - highlight = "StatusLineGitDelete", - }, -}) --- get output from shell command -function os.capture(cmd, raw) - local f = assert(io.popen(cmd, "r")) - local s = assert(f:read "*a") - f:close() - if raw then - return s - end - s = string.gsub(s, "^%s+", "") - s = string.gsub(s, "%s+$", "") - s = string.gsub(s, "[\n\r]+", " ") - return s -end --- cleanup virtual env -local function env_cleanup(venv) - if string.find(venv, "/") then - local final_venv = venv - for w in venv:gmatch "([^/]+)" do - final_venv = w - end - venv = final_venv - end - return venv -end -local PythonEnv = function() - if vim.bo.filetype == "python" then - local venv = os.getenv "CONDA_DEFAULT_ENV" - if venv ~= nil then - return "🅒 (" .. env_cleanup(venv) .. ")" - end - venv = os.getenv "VIRTUAL_ENV" - if venv ~= nil then - return " (" .. env_cleanup(venv) .. ")" - end - return "" - end - return "" -end -table.insert(gls.left, { - VirtualEnv = { - provider = PythonEnv, - highlight = "StatusLineTreeSitter", - event = "BufEnter", - }, -}) - -table.insert(gls.right, { - DiagnosticError = { - provider = "DiagnosticError", - icon = " ", - highlight = "StatusLineLspDiagnosticsError", - }, -}) -table.insert(gls.right, { - DiagnosticWarn = { - provider = "DiagnosticWarn", - icon = " ", - - highlight = "StatusLineLspDiagnosticsWarning", - }, -}) - -table.insert(gls.right, { - DiagnosticInfo = { - provider = "DiagnosticInfo", - icon = " ", - - highlight = "StatusLineLspDiagnosticsInformation", - }, -}) - -table.insert(gls.right, { - DiagnosticHint = { - provider = "DiagnosticHint", - icon = " ", - - highlight = "StatusLineLspDiagnosticsHint", - }, -}) - -table.insert(gls.right, { - TreesitterIcon = { - provider = function() - if next(vim.treesitter.highlighter.active) ~= nil then - return " " - end - return "" - end, - separator = " ", - separator_highlight = "StatusLineSeparator", - highlight = "StatusLineTreeSitter", - }, -}) - -local get_lsp_client = function(msg) - msg = msg or "LSP Inactive" - local buf_ft = vim.api.nvim_buf_get_option(0, "filetype") - local clients = vim.lsp.get_active_clients() - if next(clients) == nil then - return msg - end - local lsps = "" - for _, client in ipairs(clients) do - local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes, buf_ft) ~= 1 then - -- print(client.name) - if lsps == "" then - -- print("first", lsps) - lsps = client.name - else - lsps = lsps .. ", " .. client.name - -- print("more", lsps) - end - end - end - if lsps == "" then - return msg - else - return lsps - end -end - -table.insert(gls.right, { - ShowLspClient = { - provider = get_lsp_client, - condition = function() - local tbl = { ["dashboard"] = true, [" "] = true } - if tbl[vim.bo.filetype] then - return false - end - return true - end, - icon = " ", - highlight = "StatusLineNC", - }, -}) - -table.insert(gls.right, { - LineInfo = { - provider = "LineColumn", - separator = " ", - separator_highlight = "StatusLineSeparator", - highlight = "StatusLineNC", - }, -}) - -table.insert(gls.right, { - PerCent = { - provider = "LinePercent", - separator = " ", - separator_highlight = "StatusLineSeparator", - highlight = "StatusLineNC", - }, -}) - -table.insert(gls.right, { - Tabstop = { - provider = function() - return "Spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth") .. " " - end, - condition = condition.hide_in_width, - separator = " ", - separator_highlight = "StatusLineSeparator", - highlight = "StatusLineNC", - }, -}) - -table.insert(gls.right, { - BufferType = { - provider = "FileTypeName", - condition = condition.hide_in_width, - separator = " ", - separator_highlight = "StatusLineSeparator", - highlight = "StatusLineNC", - }, -}) - -table.insert(gls.right, { - FileEncode = { - provider = "FileEncode", - condition = condition.hide_in_width, - separator = " ", - separator_highlight = "StatusLineSeparator", - highlight = "StatusLineNC", - }, -}) - -table.insert(gls.right, { - Space = { - provider = function() - return " " - end, - separator = " ", - separator_highlight = "StatusLineSeparator", - highlight = "StatusLineNC", - }, -}) - -table.insert(gls.short_line_left, { - BufferType = { - provider = "FileTypeName", - separator = " ", - separator_highlight = "StatusLineSeparator", - highlight = "StatusLineNC", - }, -}) - -table.insert(gls.short_line_left, { - SFileName = { - provider = "SFileName", - condition = condition.buffer_not_empty, - - highlight = "StatusLineNC", - }, -}) - ---table.insert(gls.short_line_right[1] = {BufferIcon = {provider = 'BufferIcon', highlight = {colors.grey, colors.bg}}}) diff --git a/.config/nvim/lua/cfg/gitsigns/init.lua b/.config/nvim/lua/cfg/gitsigns/init.lua deleted file mode 100644 index 920c312..0000000 --- a/.config/nvim/lua/cfg/gitsigns/init.lua +++ /dev/null @@ -1,57 +0,0 @@ -local M = {} - -M.config = function() - local status_ok, gitsigns = pcall(require, "gitsigns") - if not status_ok then - return - end - gitsigns.setup { - signs = { - -- TODO add hl to colorscheme - add = { - hl = "GitSignsAdd", - text = "▎", - numhl = "GitSignsAddNr", - linehl = "GitSignsAddLn", - }, - change = { - hl = "GitSignsChange", - text = "▎", - numhl = "GitSignsChangeNr", - linehl = "GitSignsChangeLn", - }, - delete = { - hl = "GitSignsDelete", - text = "契", - numhl = "GitSignsDeleteNr", - linehl = "GitSignsDeleteLn", - }, - topdelete = { - hl = "GitSignsDelete", - text = "契", - numhl = "GitSignsDeleteNr", - linehl = "GitSignsDeleteLn", - }, - changedelete = { - hl = "GitSignsChange", - text = "▎", - numhl = "GitSignsChangeNr", - linehl = "GitSignsChangeLn", - }, - }, - numhl = false, - linehl = false, - keymaps = { - -- Default keymap options - noremap = true, - buffer = true, - }, - watch_index = { interval = 1000 }, - sign_priority = 6, - update_debounce = 200, - status_formatter = nil, -- Use default - use_decoration_api = false, - } -end - -return M diff --git a/.config/nvim/lua/cfg/hop/init.lua b/.config/nvim/lua/cfg/hop/init.lua deleted file mode 100644 index acd4cd7..0000000 --- a/.config/nvim/lua/cfg/hop/init.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.api.nvim_set_keymap('n', 's', ":HopChar2<cr>", {silent = true}) -vim.api.nvim_set_keymap('n', 'S', ":HopWord<cr>", {silent = true}) diff --git a/.config/nvim/lua/cfg/lsp/emmet-ls.lua b/.config/nvim/lua/cfg/lsp/emmet-ls.lua deleted file mode 100644 index fcb7f62..0000000 --- a/.config/nvim/lua/cfg/lsp/emmet-ls.lua +++ /dev/null @@ -1,23 +0,0 @@ --- if not package.loaded['lspconfig'] then --- return --- end - -local nvim_lsp = require'lspconfig' -local configs = require'lspconfig/configs' -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities.textDocument.completion.completionItem.snippetSupport = true - -configs.emmet_ls = { - default_config = { - cmd = {'emmet-ls', '--stdio'}; - filetypes = {'html', 'css', 'javascript', 'typescript'}; - root_dir = function() - return vim.loop.cwd() - end; - settings = {}; - }; -} - -nvim_lsp.emmet_ls.setup{ - -- on_attach = on_attach; -} diff --git a/.config/nvim/lua/cfg/lsp/init.lua b/.config/nvim/lua/cfg/lsp/init.lua deleted file mode 100644 index 547f9e7..0000000 --- a/.config/nvim/lua/cfg/lsp/init.lua +++ /dev/null @@ -1,174 +0,0 @@ --- TODO figure out why this don't work -vim.fn.sign_define( - "LspDiagnosticsSignError", - {texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError"} -) -vim.fn.sign_define( - "LspDiagnosticsSignWarning", - {texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"} -) -vim.fn.sign_define( - "LspDiagnosticsSignHint", - {texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"} -) -vim.fn.sign_define( - "LspDiagnosticsSignInformation", - {texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"} -) - -vim.cmd("nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>") -vim.cmd("nnoremap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR>") -vim.cmd("nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>") -vim.cmd("nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR>") -vim.cmd("nnoremap <silent> K :lua vim.lsp.buf.hover()<CR>") --- vim.cmd('nnoremap <silent> <C-k> <cmd>lua vim.lsp.buf.signature_help()<CR>') -vim.cmd("nnoremap <silent> <C-p> :lua vim.lsp.diagnostic.goto_prev({popup_opts = {border = O.lsp.popup_border}})<CR>") -vim.cmd("nnoremap <silent> <C-n> :lua vim.lsp.diagnostic.goto_next({popup_opts = {border = O.lsp.popup_border}})<CR>") --- scroll down hover doc or scroll in definition preview --- scroll up hover doc -vim.cmd('command! -nargs=0 LspVirtualTextToggle lua require("lsp/virtual_text").toggle()') - --- Set Default Prefix. --- Note: You can set a prefix per lsp server in the lv-globals.lua file -vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = { - prefix = "", - spacing = 0, - }, - signs = true, - underline = true, - } -) - -vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( - vim.lsp.handlers.hover, { - border = O.lsp.popup_border - } -) - -vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( - vim.lsp.handlers.signature_help, { - border = O.lsp.popup_border - } -) - --- symbols for autocomplete -vim.lsp.protocol.CompletionItemKind = { - " (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)" -} - ---[[ " autoformat -autocmd BufWritePre *.js lua vim.lsp.buf.formatting_sync(nil, 100) -autocmd BufWritePre *.jsx lua vim.lsp.buf.formatting_sync(nil, 100) -autocmd BufWritePre *.lua lua vim.lsp.buf.formatting_sync(nil, 100) ]] --- Java --- autocmd FileType java nnoremap ca <Cmd>lua require('jdtls').code_action()<CR> - -local function documentHighlight(client, bufnr) - -- Set autocommands conditional on server_capabilities - if client.resolved_capabilities.document_highlight then - vim.api.nvim_exec( - [[ - hi LspReferenceRead cterm=bold ctermbg=red guibg=#464646 - hi LspReferenceText cterm=bold ctermbg=red guibg=#464646 - hi LspReferenceWrite cterm=bold ctermbg=red guibg=#464646 - augroup lsp_document_highlight - autocmd! * <buffer> - autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight() - autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references() - augroup END - ]], - false - ) - end -end -local lsp_config = {} - -if O.document_highlight then - function lsp_config.common_on_attach(client, bufnr) - documentHighlight(client, bufnr) - end -end - -function lsp_config.tsserver_on_attach(client, bufnr) - -- lsp_config.common_on_attach(client, bufnr) - client.resolved_capabilities.document_formatting = false - - local ts_utils = require("nvim-lsp-ts-utils") - - -- defaults - ts_utils.setup { - debug = false, - disable_commands = false, - enable_import_on_completion = false, - import_all_timeout = 5000, -- ms - - -- eslint - eslint_enable_code_actions = true, - eslint_enable_disable_comments = true, - eslint_bin = O.lang.tsserver.linter, - eslint_config_fallback = nil, - eslint_enable_diagnostics = true, - - -- formatting - enable_formatting = O.lang.tsserver.autoformat, - formatter = O.lang.tsserver.formatter, - formatter_config_fallback = nil, - - -- parentheses completion - complete_parens = false, - signature_help_in_parens = false, - - -- update imports on file move - update_imports_on_move = false, - require_confirmation_on_move = false, - watch_dir = nil, - } - - -- required to fix code action ranges - ts_utils.setup_client(client) - - -- TODO: keymap these? - -- vim.api.nvim_buf_set_keymap(bufnr, "n", "gs", ":TSLspOrganize<CR>", {silent = true}) - -- vim.api.nvim_buf_set_keymap(bufnr, "n", "qq", ":TSLspFixCurrent<CR>", {silent = true}) - -- vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", ":TSLspRenameFile<CR>", {silent = true}) - -- vim.api.nvim_buf_set_keymap(bufnr, "n", "gi", ":TSLspImportAll<CR>", {silent = true}) -end - - -require('cfg.utils').define_augroups({ - _general_lsp = { - {'FileType', 'lspinfo', 'nnoremap <silent> <buffer> q :q<CR>'}, - } -}) - --- Use a loop to conveniently both setup defined servers --- and map buffer local keybindings when the language server attaches --- local servers = {"pyright", "tsserver"} --- for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup {on_attach = on_attach} end -return lsp_config diff --git a/.config/nvim/lua/cfg/lsp/ts-fmt-lint.lua b/.config/nvim/lua/cfg/lsp/ts-fmt-lint.lua deleted file mode 100644 index 36d4ca8..0000000 --- a/.config/nvim/lua/cfg/lsp/ts-fmt-lint.lua +++ /dev/null @@ -1,37 +0,0 @@ --- Example configuations here: https://github.com/mattn/efm-langserver --- You can look for project scope Prettier and Eslint with e.g. vim.fn.glob("node_modules/.bin/prettier") etc. If it is not found revert to global Prettier where needed. -local M = {} - -M.setup = function() - local tsserver_args = {} - - local prettier = { - formatCommand = "prettier --stdin-filepath ${INPUT}", - formatStdin = true - } - - if vim.fn.glob("node_modules/.bin/prettier") ~= "" then - prettier = { - formatCommand = "./node_modules/.bin/prettier --stdin-filepath ${INPUT}", - formatStdin = true - } - end - - require"lspconfig".efm.setup { - -- init_options = {initializationOptions}, - cmd = {DATA_PATH .. "/lspinstall/efm/efm-langserver"}, - init_options = {documentFormatting = true, codeAction = false}, - filetypes = {"html", "css", "yaml", "vue", "javascript", "javascriptreact", "typescript", "typescriptreact"}, - settings = { - rootMarkers = {".git/", "package.json"}, - languages = { - html = {prettier}, - css = {prettier}, - json = {prettier}, - yaml = {prettier} - } - } - } -end - -return M diff --git a/.config/nvim/lua/cfg/lspinstall/init.lua b/.config/nvim/lua/cfg/lspinstall/init.lua deleted file mode 100644 index af5e175..0000000 --- a/.config/nvim/lua/cfg/lspinstall/init.lua +++ /dev/null @@ -1 +0,0 @@ -require("lspinstall").setup() diff --git a/.config/nvim/lua/cfg/neoformat/init.lua b/.config/nvim/lua/cfg/neoformat/init.lua deleted file mode 100644 index 9a5ac76..0000000 --- a/.config/nvim/lua/cfg/neoformat/init.lua +++ /dev/null @@ -1,23 +0,0 @@ --- autoformat -if O.format_on_save then - require("cfg.utils").define_augroups({ - autoformat = { - { - "BufWritePre", - "*", - [[try | undojoin | Neoformat | catch /^Vim\%((\a\+)\)\=:E790/ | finally | silent Neoformat | endtry]], - }, - }, - }) -end - -vim.g.neoformat_run_all_formatters = 0 - -vim.g.neoformat_enabled_python = { "flake8", "black", "docformatter" } -vim.g.neoformat_enabled_javascript = { "prettier" } - -if not O.format_on_save then - vim.cmd([[if exists('#autoformat#BufWritePre') - :autocmd! autoformat - endif]]) -end diff --git a/.config/nvim/lua/cfg/nvimtree/init.lua b/.config/nvim/lua/cfg/nvimtree/init.lua deleted file mode 100644 index 97cfe03..0000000 --- a/.config/nvim/lua/cfg/nvimtree/init.lua +++ /dev/null @@ -1,87 +0,0 @@ --- --if not package.loaded['nvim-tree.view'] then --- -- return --- --end --- -local M = {} -local status_ok, nvim_tree_config = pcall(require, "nvim-tree.config") -if not status_ok then - return -end --- -M.config = function() - local g = vim.g - - vim.o.termguicolors = true - - g.nvim_tree_side = "left" - g.nvim_tree_width = 30 - g.nvim_tree_ignore = { ".git", "node_modules", ".cache" } - g.nvim_tree_auto_open = 1 - g.nvim_tree_auto_close = 0 - g.nvim_tree_quit_on_open = 0 - g.nvim_tree_follow = 1 - g.nvim_tree_indent_markers = 1 - g.nvim_tree_hide_dotfiles = 1 - g.nvim_tree_git_hl = 1 - g.nvim_tree_root_folder_modifier = ":t" - g.nvim_tree_tab_open = 0 - g.nvim_tree_allow_resize = 1 - g.nvim_tree_lsp_diagnostics = 1 - g.nvim_tree_auto_ignore_ft = { "startify", "dashboard" } - - g.nvim_tree_show_icons = { - git = 1, - folders = 1, - files = 1, - folder_arrows = 1, - } - - vim.g.nvim_tree_icons = { - default = "", - symlink = "", - git = { - unstaged = "", - staged = "S", - unmerged = "", - renamed = "➜", - deleted = "", - untracked = "U", - ignored = "◌", - }, - folder = { - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "", - }, - } - local tree_cb = nvim_tree_config.nvim_tree_callback - - vim.g.nvim_tree_bindings = { - { key = { "l", "<CR>", "o" }, cb = tree_cb "edit" }, - { key = "h", cb = tree_cb "close_node" }, - { key = "v", cb = tree_cb "vsplit" }, - } -end - -local view_status_ok, view = pcall(require, "nvim-tree.view") -if not view_status_ok then - return -end -M.toggle_tree = function() - if view.win_open() then - require("nvim-tree").close() - if package.loaded["bufferline.state"] then - require("bufferline.state").set_offset(0) - end - else - if package.loaded["bufferline.state"] then - -- require'bufferline.state'.set_offset(31, 'File Explorer') - require("bufferline.state").set_offset(31, "") - end - require("nvim-tree").find_file(true) - end -end --- -return M diff --git a/.config/nvim/lua/cfg/symbols-outline/init.lua b/.config/nvim/lua/cfg/symbols-outline/init.lua deleted file mode 100644 index f15b5df..0000000 --- a/.config/nvim/lua/cfg/symbols-outline/init.lua +++ /dev/null @@ -1,15 +0,0 @@ -vim.g.symbols_outline = { - highlight_hovered_item = true, - show_guides = true, - auto_preview = true, - position = "right", - keymaps = { - close = "<Esc>", - goto_location = "<Cr>", - focus_location = "o", - hover_symbol = "<C-space>", - rename_symbol = "r", - code_actions = "a", - }, - lsp_blacklist = {}, -} diff --git a/.config/nvim/lua/cfg/telescope/init.lua b/.config/nvim/lua/cfg/telescope/init.lua deleted file mode 100644 index 9e0c45f..0000000 --- a/.config/nvim/lua/cfg/telescope/init.lua +++ /dev/null @@ -1,89 +0,0 @@ -local status_ok, telescope = pcall(require, "telescope") -if not status_ok then - return -end -local actions = require "telescope.actions" --- if O.plugin.trouble.active then --- local trouble = require("trouble.providers.telescope") --- end --- Global remapping ------------------------------- --- '--color=never', -telescope.setup { - defaults = { - find_command = { - "rg", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - }, - prompt_prefix = " ", - selection_caret = " ", - entry_prefix = " ", - initial_mode = "insert", - selection_strategy = "reset", - sorting_strategy = "ascending", - layout_strategy = "horizontal", - layout_config = { - width = 0.75, - prompt_position = "top", - preview_cutoff = 120, - horizontal = { mirror = false }, - vertical = { mirror = false }, - }, - file_sorter = require("telescope.sorters").get_fzy_sorter, - file_ignore_patterns = {}, - generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, - path_display = {"shorten"}, - winblend = 0, - border = {}, - borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, - color_devicons = true, - use_less = true, - set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil, - file_previewer = require("telescope.previewers").vim_buffer_cat.new, - grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, - qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, - - -- Developer configurations: Not meant for general override - buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker, - mappings = { - i = { - ["<C-c>"] = actions.close, - ["<C-j>"] = actions.move_selection_next, - ["<C-k>"] = actions.move_selection_previous, - -- ["<c-t>"] = trouble.open_with_trouble, - ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist, - -- To disable a keymap, put [map] = false - -- So, to not map "<C-n>", just put - -- ["<c-x>"] = false, - -- ["<esc>"] = actions.close, - - -- Otherwise, just set the mapping to the function that you want it to be. - -- ["<C-i>"] = actions.select_horizontal, - - -- Add up multiple actions - ["<CR>"] = actions.select_default + actions.center, - - -- You can perform as many actions in a row as you like - -- ["<CR>"] = actions.select_default + actions.center + my_cool_custom_action, - }, - n = { - ["<C-j>"] = actions.move_selection_next, - ["<C-k>"] = actions.move_selection_previous, - -- ["<c-t>"] = trouble.open_with_trouble, - ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist, - -- ["<C-i>"] = my_cool_custom_action, - }, - }, - }, - extensions = { - fzy_native = { - override_generic_sorter = false, - override_file_sorter = true, - }, - }, -} - diff --git a/.config/nvim/lua/cfg/themes/dark.lua b/.config/nvim/lua/cfg/themes/dark.lua deleted file mode 100644 index 935b2be..0000000 --- a/.config/nvim/lua/cfg/themes/dark.lua +++ /dev/null @@ -1,367 +0,0 @@ -local lush = require "lush" -local hsl = lush.hsl - -local theme = lush(function() - local c = { - bg = hsl "#0A0A0A", - bg1 = hsl "#0D0D0D", - bg2 = hsl "#202020", - - white = hsl "#f5f5f5", - - gray = hsl "#505050", - light_gray = hsl "#D0D0D0", - - error_red = hsl "#AC4142", - warning_orange = hsl "#F4BF75", - info_yellow = hsl "#F4BF75", - hint_blue = hsl "#A5D6FF", - - red = hsl "#AC4142", - - blue = hsl "#A5D6FF", - gray_blue = hsl "#A5D6FF", - - yellow = hsl "#F4BF75", - - orange = hsl "#FFA657", - - green = hsl "#A1B56C", - light_green = hsl "#A1B56C", - - aqua = hsl "#A5D6FF", - - purple = hsl "#AA759F", - pale_purple = hsl "#A5D6FF", - - sign_add = hsl "#A1B56C", - sign_change = hsl "#A5D6FF", - sign_delete = hsl "#AC4142", - } - return { - Normal { bg = c.bg, fg = c.white, gui = "NONE" }, -- used for the columns set with 'colorcolumn' - SignColumn { Normal }, - ModeMsg { Normal }, - MsgArea { Normal }, - MsgSeparator { Normal }, - SpellBad { bg = "NONE", fg = c.white, gui = "underline", sp = c.red }, - SpellCap { bg = "NONE", fg = c.white, gui = "underline", sp = c.yellow }, - SpellLocal { bg = "NONE", fg = c.white, gui = "underline", sp = c.green }, - SpellRare { bg = "NONE", fg = c.white, gui = "underline", sp = c.blue }, - NormalNC { Normal }, - Pmenu { bg = c.bg2, fg = c.white, gui = "NONE" }, - PmenuSel { bg = c.gray_blue, fg = c.bg1.da(5), gui = "NONE" }, - WildMenu { PmenuSel }, -- Non Defaults - CursorLineNr { bg = "NONE", fg = c.light_gray, gui = "bold" }, - Comment { bg = "NONE", fg = c.gray, gui = "italic" }, -- any comment - Folded { bg = c.bg1, fg = c.gray, gui = "NONE" }, - FoldColumn { Normal, fg = c.gray, gui = "NONE" }, - LineNr { bg = "NONE", fg = c.gray, gui = "NONE" }, - FloatBorder { bg = c.bg1, fg = c.gray, gui = "NONE" }, - Whitespace { bg = "NONE", fg = c.gray.da(35), gui = "NONE" }, - VertSplit { bg = "NONE", fg = c.bg2, gui = "NONE" }, - CursorLine { bg = c.bg1, fg = "NONE", gui = "NONE" }, - CursorColumn { CursorLine }, - ColorColumn { CursorLine }, - NormalFloat { bg = c.bg2.da(30), fg = "NONE", gui = "NONE" }, - Visual { bg = c.bg2.da(25), fg = "NONE", gui = "NONE" }, - VisualNOS { Visual }, - WarningMsg { bg = "NONE", fg = c.red, gui = "NONE" }, - DiffText { bg = "NONE", fg = "NONE", gui = "NONE" }, - DiffAdd { bg = c.sign_add, fg = "NONE", gui = "NONE" }, - DiffChange { bg = c.sign_change, fg = "NONE", gui = "NONE" }, - DiffDelete { bg = c.sign_delete, fg = "NONE", gui = "NONE" }, - QuickFixLine { CursorLine }, - PmenuSbar { bg = c.bg2.li(15), fg = "NONE", gui = "NONE" }, - PmenuThumb { bg = c.white, fg = "NONE", gui = "NONE" }, - MatchParen { CursorLine, fg = "NONE", gui = "NONE" }, - Cursor { fg = "NONE", bg = "NONE", gui = "reverse" }, - lCursor { Cursor }, - CursorIM { Cursor }, - TermCursor { Cursor }, - TermCursorNC { Cursor }, - Conceal { bg = "NONE", fg = c.blue, gui = "NONE" }, - Directory { bg = "NONE", fg = c.blue, gui = "NONE" }, - SpecialKey { bg = "NONE", fg = c.blue, gui = "bold" }, - Title { bg = "NONE", fg = c.blue, gui = "bold" }, - ErrorMsg { bg = "NONE", fg = c.error_red, gui = "NONE" }, - Search { bg = c.gray_blue, fg = c.white }, - IncSearch { Search }, - Substitute { Search }, - MoreMsg { bg = "NONE", fg = c.aqua, gui = "NONE" }, - Question { MoreMsg }, - EndOfBuffer { bg = "NONE", fg = c.bg, gui = "NONE" }, - NonText { EndOfBuffer }, - - String { fg = c.blue }, - Character { fg = c.light_green }, - Constant { fg = c.orange }, - Number { fg = c.red }, - Boolean { fg = c.red }, - Float { fg = c.red }, - - Identifier { fg = c.white }, - Function { fg = c.purple }, - Operator { fg = c.orange }, - - Type { fg = c.white }, - StorageClass { fg = c.yellow }, - Structure { fg = c.orange }, - Typedef { fg = c.purple }, - - Keyword { fg = c.orange }, - Statement { Keyword }, - Conditional { Keyword }, - Repeat { Keyword }, - Label { Keyword }, - Exception { Keyword }, - - Include { Keyword }, - PreProc { fg = c.orange }, - Define { PreProc }, - Macro { PreProc }, - PreCondit { PreProc }, - - Special { fg = c.orange }, - SpecialChar { Character }, - Tag { fg = c.pale_purple }, - Debug { fg = c.red }, - Delimiter { fg = c.white.da(25) }, - SpecialComment { fg = c.gray }, - Underlined { fg = "NONE", gui = "underline" }, - Bold { fg = "NONE", gui = "bold" }, - Italic { fg = "NONE", gui = "italic" }, - - -- Todo - -- ("Ignore", below, may be invisible...) - Ignore { fg = c.white }, - Todo { bg = "NONE", fg = c.red, gui = "bold" }, - Error { fg = c.error_red }, - - -- Treesitter - TSComment { Comment }, -- comment blocks. - luaTSConstructor { bg = "NONE", fg = c.white.da(25) }, -- override Lua curly braces - TSAnnotation { bg = "NONE", fg = c.aqua }, -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information. - TSAttribute { bg = "NONE", fg = c.aqua }, -- (unstable) TODO: docs - TSConstructor { Type }, -- For constructor calls and definitions: `{ }` in Lua, and Java constructors. - TSType { Type }, -- types. - TSTypeBuiltin { Type }, -- builtin types. - TSConditional { Conditional }, -- keywords related to conditionnals. - TSException { Exception }, -- exception related keywords. - TSInclude { Include }, -- includes: `#include` in C, `use` or `extern crate` in Rust, or `require` in Lua. - TSKeyword { Keyword }, -- keywords that don't fall in previous categories. - TSKeywordFunction { Keyword }, -- keywords used to define a fuction. - TSLabel { Label }, -- labels: `label:` in C and `:label:` in Lua. - TSNamespace { bg = "NONE", fg = c.blue }, -- For identifiers referring to modules and namespaces. - TSRepeat { Repeat }, -- keywords related to loops. - TSConstant { Constant }, -- constants - TSConstBuiltin { Constant }, -- constant that are built in the language: `nil` in Lua. - TSFloat { Float }, -- floats. - TSNumber { Number }, -- all numbers - TSBoolean { Boolean }, -- booleans. - TSCharacter { Character }, -- characters. - TSError { bg = "NONE", fg = "NONE" }, -- For syntax/parser errors. - TSFunction { Function }, -- function (calls and definitions). - TSFuncBuiltin { Function }, -- builtin functions: `table.insert` in Lua. - TSMethod { Function }, -- method calls and definitions. - TSConstMacro { Macro }, -- constants that are defined by macros: `NULL` in C. - TSFuncMacro { Macro }, -- macro defined fuctions (calls and definitions): each `macro_rules` in Rust. - TSVariableBuiltin { bg = "NONE", fg = c.aqua }, -- Variable names that are defined by the languages, like `this` or `self`. - TSProperty { fg = c.aqua }, - TSOperator { Operator }, -- any operator: `+`, but also `->` and `*` in C. - TSVariable { bg = "NONE", fg = c.white }, -- Any variable name that does not have another highlight. - TSField { bg = "NONE", fg = c.white }, -- For fields. - TSParameter { TSField }, -- parameters of a function. - TSParameterReference { TSParameter }, -- references to parameters of a function. - TSSymbol { Identifier }, -- identifiers referring to symbols or atoms. - TSText { fg = c.white }, -- strings considered text in a markup language. - TSPunctDelimiter { Delimiter }, -- delimiters ie: `.` - TSTagDelimiter { Delimiter }, -- Tag delimiter like `<` `>` `/` - TSPunctBracket { Delimiter }, -- brackets and parens. - TSPunctSpecial { Delimiter }, -- special punctutation that does not fall in the catagories before. - TSString { String }, -- strings. - TSStringRegex { TSString }, -- regexes. - TSStringEscape { Character }, -- escape characters within a string. - TSWarning { Todo }, -- Variable names that are defined by the languages, like `this` or `self`. - TSTag { Tag }, -- Tags like html tag names. - TSEmphasis { gui = "italic" }, -- text to be represented with emphasis. - TSUnderline { gui = "underline" }, -- text to be represented with an underline. - TSStrike { gui = "strikethrough" }, -- strikethrough text. - TSTitle { Title }, -- Text that is part of a title. - TSLiteral { String }, -- Literal text. - TSURI { fg = c.aqua }, -- Any URI like a link or email. - -- TSNone { }, -- TODO: docs - - -- These groups are for the native LSP client. Some other LSP clients may - -- use these groups, or use their own. Consult your LSP client's - -- documentation. - - LspDiagnosticsDefaultError { bg = "NONE", fg = c.error_red, gui = "NONE" }, - LspDiagnosticsDefaultWarning { bg = "NONE", fg = c.warning_orange, gui = "NONE" }, - LspDiagnosticsDefaultInformation { bg = "NONE", fg = c.info_yellow, gui = "NONE" }, - LspDiagnosticsDefaultHint { bg = "NONE", fg = c.hint_blue, gui = "NONE" }, - - LspDiagnosticsVirtualTextError { LspDiagnosticsDefaultError }, - LspDiagnosticsVirtualTextWarning { LspDiagnosticsDefaultWarning }, - LspDiagnosticsVirtualTextInformation { LspDiagnosticsDefaultInformation }, - LspDiagnosticsVirtualTextHint { LspDiagnosticsDefaultHint }, - - LspDiagnosticsFloatingError { fg = c.error_red, gui = "NONE" }, - LspDiagnosticsFloatingWarning { fg = c.warning_orange, gui = "NONE" }, - LspDiagnosticsFloatingInformation { fg = c.info_yellow, gui = "NONE" }, - LspDiagnosticsFloatingHint { fg = c.hint_blue, gui = "NONE" }, - - LspDiagnosticsSignError { fg = c.error_red, gui = "NONE" }, - LspDiagnosticsSignWarning { fg = c.warning_orange, gui = "NONE" }, - LspDiagnosticsSignInformation { fg = c.info_yellow, gui = "NONE" }, - LspDiagnosticsSignHint { fg = c.hint_blue, gui = "NONE" }, -- Tree-Sitter - - LspDiagnosticsError { LspDiagnosticsSignError }, - LspDiagnosticsWarning { LspDiagnosticsSignWarning }, - LspDiagnosticsInformation { LspDiagnosticsSignInformation }, - LspDiagnosticsHint { LspDiagnosticsSignHint }, - - -- LspReferenceText {bg = c.bg1, fg = "NONE", gui = "underline"}, - -- LspReferenceRead {bg = c.bg1, fg = "NONE", gui = "underline"}, - -- LspReferenceWrite {bg = c.bg1, fg = "NONE", gui = "underline"}, - - LspDiagnosticsUnderlineError { fg = "NONE", gui = "underline", sp = c.red }, - LspDiagnosticsUnderlineWarning { fg = "NONE", gui = "underline", sp = c.yellow }, - LspDiagnosticsUnderlineInformation { fg = "NONE", gui = "underline", sp = c.blue }, - LspDiagnosticsUnderlineHint { fg = "NONE", gui = "underline", sp = c.green }, - - -- gitsigns.nvim - SignAdd { fg = c.sign_add }, - SignChange { fg = c.sign_change }, - SignDelete { fg = c.sign_delete }, -- Any URI like a link or email. - GitSignsAdd { fg = c.sign_add }, - GitSignsChange { fg = c.sign_change }, - GitSignsDelete { fg = c.sign_delete }, - - -- telescope.nvim - TelescopeSelection { bg = "NONE", fg = c.aqua }, - TelescopeMatching { bg = "NONE", fg = c.red, gui = "bold" }, - TelescopeBorder { bg = c.bg1, fg = c.gray }, -- nvim-tree.lua - - -- Nvimtree - NvimTreeFolderIcon { fg = c.blue }, - NvimTreeIndentMarker { fg = c.gray }, - NvimTreeNormal { fg = c.white.da(10), bg = c.bg1 }, - NvimTreeFolderName { fg = c.blue }, - NvimTreeOpenedFolderName { fg = c.aqua.da(10), gui = "italic" }, - NvimTreeOpenedFile { NvimTreeOpenedFolderName }, - NvimTreeRootFolder { fg = c.blue.da(20) }, - NvimTreeExecFile { fg = c.green }, - NvimTreeImageFile { fg = c.purple }, - NvimTreeSpecialFile { fg = c.aqua }, - - NvimTreeGitStaged { fg = c.sign_add }, - NvimTreeGitNew { fg = c.sign_add }, - NvimTreeGitDirty { fg = c.sign_add }, - NvimTreeGitRenamed { fg = c.sign_change }, - NvimTreeGitMerge { fg = c.sign_change }, - NvimTreeGitDelete { fg = c.sign_delete }, - NvimTreeVertSplit { fg = c.bg1, bg = c.bg1 }, - - -- BarBar - TabLine { bg = c.bg1, fg = c.white, gui = "NONE" }, - TabLineFill { bg = c.bg1, fg = c.gray, gui = "NONE" }, - TabLineSel { bg = c.white, fg = c.bg1, gui = "NONE" }, - - BufferCurrent { fg = c.fg, bg = c.bg }, - BufferCurrentIndex { fg = c.aqua, bg = c.bg }, - BufferCurrentMod { fg = c.info_yellow, bg = c.bg }, - BufferCurrentSign { fg = c.aqua, bg = c.bg }, - BufferCurrentTarget { fg = c.red, bg = c.bg, gui = "bold" }, - - BufferVisible { fg = c.fg, bg = c.bg }, - BufferVisibleIndex { fg = c.fg, bg = c.bg }, - BufferVisibleMod { fg = c.info_yellow, bg = c.bg }, - BufferVisibleSign { fg = c.info_yellow, bg = c.bg }, - BufferVisibleTarget { fg = c.red, bg = c.bg, gui = "bold" }, - - BufferInactive { fg = c.gray, bg = c.bg1 }, - BufferInactiveIndex { fg = c.gray, bg = c.bg1 }, - BufferInactiveMod { fg = c.info_yellow, bg = c.bg1 }, - BufferInactiveSign { fg = c.gray, bg = c.bg1 }, - BufferInactiveTarget { fg = c.red, bg = c.bg1 }, - - -- some fix for html related stuff - htmlH1 { Title }, -- markdown stuff - mkdLink { fg = c.aqua, gui = "underline" }, - mkdLineBreak { bg = "NONE", fg = "NONE", gui = "NONE" }, - mkdHeading { fg = c.white }, - mkdInlineURL { mkdLink }, - mkdUnderline { fg = c.gray }, - markdownUrl { mkdLink }, - markdownCode { fg = c.orange, bg = "NONE" }, - markdownLinkTextDelimiter { Delimiter }, - markdownLinkDelimiter { Delimiter }, - markdownIdDelimiter { Delimiter }, - markdownLinkText { fg = c.aqua }, - markdownItalic { fg = "NONE", gui = "italic" }, -- flutter-tools.nvim - FlutterWidgetGuides { fg = c.gray.li(10) }, -- statusline - - StatusLine { bg = c.bg1, fg = c.white }, -- status line of current window - StatusLineNC { bg = c.bg1, fg = c.light_gray }, -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window. - StatusLineSeparator { bg = c.bg1, fg = "NONE" }, - StatusLineGit { bg = c.bg1, fg = c.orange }, - StatusLineGitAdd { bg = c.bg1, fg = c.green }, - StatusLineGitChange { bg = c.bg1, fg = c.blue }, - StatusLineGitDelete { bg = c.bg1, fg = c.red }, - StatusLineLspDiagnosticsError { bg = c.bg1, fg = c.error_red, gui = "NONE" }, - StatusLineLspDiagnosticsWarning { bg = c.bg1, fg = c.warning_orange, gui = "NONE" }, - StatusLineLspDiagnosticsInformation { bg = c.bg1, fg = c.info_yellow, gui = "NONE" }, - StatusLineLspDiagnosticsHint { bg = c.bg1, fg = c.hint_blue, gui = "NONE" }, - StatusLineTreeSitter { bg = c.bg1, fg = c.green }, - - -- StatusLineMode {bg = c.gray, fg = c.bg, gui = "bold"}, - -- StatusLineDeco {bg = c.bg2, fg = c.yellow}, - -- StatusLineLCol {bg = c.bg2, fg = c.white}, - -- StatusLineLColAlt {bg = c.bg1, fg = c.white}, - -- StatusLineFT {bg = c.bg2, fg = c.white}, - -- StatusLineFTAlt {bg = c.bg2, fg = c.white}, - -- StatusLineGitAlt {bg = c.gray, fg = c.bg}, - -- StatusLineLSP {bg = c.bg1, fg = c.gray.li(25)}, - -- StatusLineFileName {bg = c.bg1, fg = c.white, gui = "bold"}, - - -- lsp-trouble.nvim - LspTroubleIndent { fg = c.gray.li(10) }, -- tabline stuff - - -- tabline diagnostic - TabLineError { LspDiagnosticsSignError }, - TabLineWarning { LspDiagnosticsSignWarning }, - TabLineHint { LspDiagnosticsSignHint }, - TabLineInformation { LspDiagnosticsSignInformation }, -- which-key.nvim - - WhichKey { fg = c.white }, -- nvim-compe - WhichKeySeperator { fg = c.gray }, -- nvim-compe - WhichKeyGroup { fg = c.blue }, -- nvim-compe - WhichKeyDesc { fg = c.aqua }, -- nvim-compe - WhichKeyFloat { bg = c.bg1 }, -- nvim-compe - - CompeDocumentation { Pmenu, fg = "NONE" }, -- diffview - - DiffviewNormal { NvimTreeNormal }, - DiffviewStatusAdded { SignAdd }, - DiffviewStatusModified { SignChange }, - DiffviewStatusRenamed { SignChange }, - DiffviewStatusDeleted { SignDelete }, - DiffviewFilePanelInsertion { SignAdd }, - DiffviewFilePanelDeletion { SignDelete }, - DiffviewVertSplit { fg = c.gray, bg = c.bg }, - - DashboardHeader { fg = c.blue }, - DashboardCenter { fg = c.purple }, - DashboardFooter { fg = c.aqua }, - - IndentBlanklineContextChar { fg = c.gray.da(20) }, - - CodiVirtualText { fg = c.hint_blue }, - } -end) - --- return our parsed theme for extension or use else where. -return theme - --- vi:nowrap diff --git a/.config/nvim/lua/cfg/treesitter/init.lua b/.config/nvim/lua/cfg/treesitter/init.lua deleted file mode 100644 index deaa86e..0000000 --- a/.config/nvim/lua/cfg/treesitter/init.lua +++ /dev/null @@ -1,123 +0,0 @@ --- TODO refacor this whole file and treesitter in general --- if not package.loaded['nvim-treesitter'] then return end --- --- Custom parsers --- local parser_config = require("nvim-treesitter.parsers").get_parser_configs() --- parser_config.make = { --- install_info = { --- url = "https://github.com/alemuller/tree-sitter-make", -- local path or git repo --- files = {"src/parser.c"}, --- requires_generate_from_grammar = true --- } --- } --- parser_config.just = { --- install_info = { --- url = "~/dev/tree-sitter-just", -- local path or git repo --- files = {"src/parser.c"} --- } --- -- filetype = "just", -- if filetype does not agrees with parser name --- -- used_by = {"bar", "baz"} -- additional filetypes that use this parser --- } --- Custom text objects -local textobj_prefixes = O.treesitter.textobj_prefixes -local textobj_suffixes = O.treesitter.textobj_suffixes -local textobj_sel_keymaps = {} -local textobj_swap_keymaps = {} -local textobj_move_keymaps = { - enable = O.plugin.ts_textobjects, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = {}, - goto_next_end = {}, - goto_previous_start = {}, - goto_previous_end = {}, -} -for obj, suffix in pairs(textobj_suffixes) do - if textobj_prefixes["goto_next"] ~= nil then - textobj_move_keymaps["goto_next_start"][textobj_prefixes["goto_next"] .. suffix[1]] = "@" .. obj .. ".outer" - textobj_move_keymaps["goto_next_end"][textobj_prefixes["goto_next"] .. suffix[2]] = "@" .. obj .. ".outer" - end - if textobj_prefixes["goto_prev"] ~= nil then - textobj_move_keymaps["goto_previous_start"][textobj_prefixes["goto_previous"] .. suffix[2]] = "@" .. obj .. ".outer" - textobj_move_keymaps["goto_previous_end"][textobj_prefixes["goto_previous"] .. suffix[1]] = "@" .. obj .. ".outer" - end - - if textobj_prefixes["inner"] ~= nil then - textobj_sel_keymaps[textobj_prefixes["inner"] .. suffix[1]] = "@" .. obj .. ".inner" - end - if textobj_prefixes["outer"] ~= nil then - textobj_sel_keymaps[textobj_prefixes["outer"] .. suffix[1]] = "@" .. obj .. ".outer" - end - - if textobj_prefixes["swap"] ~= nil then - textobj_swap_keymaps[textobj_prefixes["swap"] .. suffix[1]] = "@" .. obj .. ".outer" - end -end -vim.g.ts_hint_textobject_keys = O.treesitter.hint_labels -- Requires https://github.com/mfussenegger/nvim-ts-hint-textobject/pull/2 - --- Add which key menu entries -local status, wk = pcall(require, "which-key") -if status then - local normal = { - mode = "n", -- Normal mode - } - local operators = { - mode = "o", -- Operator mode - } - wk.register(textobj_sel_keymaps, operators) - wk.register({ - ["m"] = "Hint Objects", - ["."] = "Textsubject", - [";"] = "Textsubject-big", - }, operators) - wk.register(textobj_swap_keymaps, normal) - wk.register({ - [textobj_prefixes["swap"]] = "Swap", - -- [textobj_prefixes["goto_next"]] = "Jump [", - -- [textobj_prefixes["goto_previous"]] = "Jump ]" - }, normal) - wk.register(textobj_move_keymaps["goto_next_start"], normal) - wk.register(textobj_move_keymaps["goto_next_end"], normal) - wk.register(textobj_move_keymaps["goto_previous_start"], normal) - wk.register(textobj_move_keymaps["goto_previous_end"], normal) -end -local status_ok, treesitter_configs = pcall(require, "nvim-treesitter.configs") -if not status_ok then - return -end - -treesitter_configs.setup { - ensure_installed = O.treesitter.ensure_installed, -- one of "all", "maintained" (parsers with maintainers), or a list of languages - ignore_install = O.treesitter.ignore_install, - matchup = { - enable = true, -- mandatory, false will disable the whole extension - -- disable = { "c", "ruby" }, -- optional, list of language that will be disabled - }, - highlight = { - enable = O.treesitter.highlight.enabled, -- false will disable the whole extension - additional_vim_regex_highlighting = true, - disable = { "latex" }, - }, - context_commentstring = { - enable = O.plugin.ts_context_commentstring.active, - config = { css = "// %s" }, - }, - -- indent = {enable = true, disable = {"python", "html, "javascript"}}, - -- TODO seems to be broken - indent = { enable = { "javascriptreact" } }, - autotag = { enable = O.plugin.ts_autotag.active }, - textobjects = { - swap = { - enable = O.plugin.ts_textobjects, - swap_next = textobj_swap_keymaps, - }, - move = textobj_move_keymaps, - select = { - enable = O.plugin.ts_textobjects, - keymaps = textobj_sel_keymaps, - }, - }, - textsubjects = { - enable = O.plugin.ts_textsubjects, - keymaps = { ["."] = "textsubjects-smart", [";"] = "textsubjects-big" }, - }, -} diff --git a/.config/nvim/lua/cfg/utils/init.lua b/.config/nvim/lua/cfg/utils/init.lua deleted file mode 100644 index 4c5dfd2..0000000 --- a/.config/nvim/lua/cfg/utils/init.lua +++ /dev/null @@ -1,112 +0,0 @@ -local utils = {} - -function utils.reload_config() - vim.cmd "source ~/.config/nvim/config.lua" - vim.cmd "source ~/.config/nvim/lua/plugins.lua" - vim.cmd "source ~/.config/nvim/lua/cfg/neoformat/init.lua" - vim.cmd ":PackerCompile" - vim.cmd ":PackerInstall" -end - -function utils.check_lsp_client_active(name) - local clients = vim.lsp.get_active_clients() - for _, client in pairs(clients) do - if client.name == name then - return true - end - end - return false -end - -function utils.define_augroups(definitions) -- {{{1 - -- Create autocommand groups based on the passed definitions - -- - -- The key will be the name of the group, and each definition - -- within the group should have: - -- 1. Trigger - -- 2. Pattern - -- 3. Text - -- just like how they would normally be defined from Vim itself - for group_name, definition in pairs(definitions) do - vim.cmd("augroup " .. group_name) - vim.cmd "autocmd!" - - for _, def in pairs(definition) do - local command = table.concat(vim.tbl_flatten { "autocmd", def }, " ") - vim.cmd(command) - end - - vim.cmd "augroup END" - end -end - -utils.define_augroups { - - _user_autocommands = O.user_autocommands, - _general_settings = { - { - "TextYankPost", - "*", - "lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200})", - }, - { - "BufWinEnter", - "*", - "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", - }, - { - "BufRead", - "*", - "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", - }, - { - "BufNewFile", - "*", - "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", - }, - { "BufWritePost", "config.lua", "lua require('cfg.utils').reload_config()" }, - { "VimLeavePre", "*", "set title set titleold=" }, - }, - -- _solidity = { - -- {'BufWinEnter', '.sol', 'setlocal filetype=solidity'}, {'BufRead', '*.sol', 'setlocal filetype=solidity'}, - -- {'BufNewFile', '*.sol', 'setlocal filetype=solidity'} - -- }, - -- _gemini = { - -- {'BufWinEnter', '.gmi', 'setlocal filetype=markdown'}, {'BufRead', '*.gmi', 'setlocal filetype=markdown'}, - -- {'BufNewFile', '*.gmi', 'setlocal filetype=markdown'} - -- }, - _markdown = { - { "FileType", "markdown", "setlocal wrap" }, - { "FileType", "markdown", "setlocal spell" }, - }, - _buffer_bindings = { - { "FileType", "floaterm", "nnoremap <silent> <buffer> q :q<CR>" }, - }, - _auto_resize = { - -- will cause split windows to be resized evenly if main window is resized - { "VimResized", "*", "wincmd =" }, - }, - _packer_compile = { - -- will cause split windows to be resized evenly if main window is resized - { "BufWritePost", "plugins.lua", "PackerCompile" }, - }, - -- _mode_switching = { - -- -- will switch between absolute and relative line numbers depending on mode - -- {'InsertEnter', '*', 'if &relativenumber | let g:ms_relativenumberoff = 1 | setlocal number norelativenumber | endif'}, - -- {'InsertLeave', '*', 'if exists("g:ms_relativenumberoff") | setlocal relativenumber | endif'}, - -- {'InsertEnter', '*', 'if &cursorline | let g:ms_cursorlineoff = 1 | setlocal nocursorline | endif'}, - -- {'InsertLeave', '*', 'if exists("g:ms_cursorlineoff") | setlocal cursorline | endif'}, - -- }, -} - -vim.cmd [[ - function! QuickFixToggle() - if empty(filter(getwininfo(), 'v:val.quickfix')) - copen - else - cclose - endif -endfunction -]] - -return utils diff --git a/.config/nvim/lua/cfg/vim-rooter/init.lua b/.config/nvim/lua/cfg/vim-rooter/init.lua deleted file mode 100644 index a873194..0000000 --- a/.config/nvim/lua/cfg/vim-rooter/init.lua +++ /dev/null @@ -1,2 +0,0 @@ --- TODO create file -vim.g.rooter_silent_chdir = 1 diff --git a/.config/nvim/lua/cfg/vimtex/init.lua b/.config/nvim/lua/cfg/vimtex/init.lua deleted file mode 100644 index 4d7b93b..0000000 --- a/.config/nvim/lua/cfg/vimtex/init.lua +++ /dev/null @@ -1,25 +0,0 @@ -vim.g.vimtex_compiler_method = "latexmk" -vim.g.vimtex_view_method = "zathura" -vim.g.vimtex_fold_enabled = 0 - -O.user_which_key["L"] = { - name = "+Latex", - c = { "<cmd>VimtexCompile<cr>", "Toggle Compilation Mode" }, - f = { "<cmd>call vimtex#fzf#run()<cr>", "Fzf Find" }, - i = { "<cmd>VimtexInfo<cr>", "Project Information" }, - s = { "<cmd>VimtexStop<cr>", "Stop Project Compilation" }, - t = { "<cmd>VimtexTocToggle<cr>", "Toggle Table Of Content" }, - v = { "<cmd>VimtexView<cr>", "View PDF" }, -} - --- Compile on initialization, cleanup on quit -vim.api.nvim_exec( - [[ - augroup vimtex_event_1 - au! - au User VimtexEventQuit call vimtex#compiler#clean(0) - au User VimtexEventInitPost call vimtex#compiler#compile() - augroup END - ]], - false -) diff --git a/.config/nvim/lua/cfg/which-key/init.lua b/.config/nvim/lua/cfg/which-key/init.lua deleted file mode 100644 index 993018c..0000000 --- a/.config/nvim/lua/cfg/which-key/init.lua +++ /dev/null @@ -1,225 +0,0 @@ --- if not package.loaded['which-key'] then --- return --- end -local status_ok, which_key = pcall(require, "which-key") -if not status_ok then - return -end - -which_key.setup { - plugins = { - marks = true, -- shows a list of your marks on ' and ` - registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode - -- the presets plugin, adds help for a bunch of default keybindings in Neovim - -- No actual key bindings are created - presets = { - operators = false, -- adds help for operators like d, y, ... - motions = false, -- adds help for motions - text_objects = false, -- help for text objects triggered after entering an operator - windows = true, -- default bindings on <c-w> - nav = true, -- misc bindings to work with windows - z = true, -- bindings for folds, spelling and others prefixed with z - g = true, -- bindings for prefixed with g - }, - }, - icons = { - breadcrumb = "»", -- symbol used in the command line area that shows your active key combo - separator = "➜", -- symbol used between a key and it's label - group = "+", -- symbol prepended to a group - }, - window = { - border = "single", -- none, single, double, shadow - position = "bottom", -- bottom, top - margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left] - padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left] - }, - layout = { - height = { min = 4, max = 25 }, -- min and max height of the columns - width = { min = 20, max = 50 }, -- min and max width of the columns - spacing = 3, -- spacing between columns - }, - hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate - show_help = true, -- show help message on the command line when the popup is visible -} - --- Set leader -if O.leader_key == " " or O.leader_key == "space" then - vim.api.nvim_set_keymap("n", "<Space>", "<NOP>", { noremap = true, silent = true }) - vim.g.mapleader = " " -else - vim.api.nvim_set_keymap("n", O.leader_key, "<NOP>", { noremap = true, silent = true }) - vim.g.mapleader = O.leader_key -end - -local opts = { - mode = "n", -- NORMAL mode - prefix = "<leader>", - buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings - silent = true, -- use `silent` when creating keymaps - noremap = true, -- use `noremap` when creating keymaps - nowait = false, -- use `nowait` when creating keymaps -} - --- no hl -vim.api.nvim_set_keymap("n", "<Leader>n", ':let @/=""<CR>', { noremap = true, silent = true }) - --- explorer - -vim.api.nvim_set_keymap( - "n", - "<Leader>e", - ":lua require'cfg.nvimtree'.toggle_tree()<CR>", - { noremap = true, silent = true } -) - -vim.api.nvim_set_keymap("n", "<Leader>f", ":Telescope find_files<CR>", { noremap = true, silent = true }) - --- dashboard -vim.api.nvim_set_keymap("n", "<Leader>;", ":Dashboard<CR>", { noremap = true, silent = true }) - --- Comments -vim.api.nvim_set_keymap("n", "<leader>k", ":CommentToggle<CR>", { noremap = true, silent = true }) -vim.api.nvim_set_keymap("v", "<leader>k", ":CommentToggle<CR>", { noremap = true, silent = true }) - --- split window -vim.api.nvim_set_keymap("n", "<leader>v", ":vsplit<CR>", {noremap = true, silent = true}) -vim.api.nvim_set_keymap("n", "<leader>h", ":split<CR>", {noremap = true, silent = true}) - - --- close buffer -vim.api.nvim_set_keymap("n", "<leader>c", ":BufferClose<CR>", { noremap = true, silent = true }) - --- open config -vim.api.nvim_set_keymap( - "n", - "<leader>.", - ":e " .. CONFIG_PATH .. "/config.lua<CR>", - { noremap = true, silent = true } -) - -local mappings = { - - ["."] = "Config", - ["k"] = "Comment", - ["c"] = "Close Buffer", - ["e"] = "Explorer", - ["f"] = "Find File", - ["n"] = "No Highlight", - [";"] = "Dashboard", - ["v"] = "Vertical Split", - ["h"] = "Horizontal Split", - p = { - name = "Packer", - c = { "<cmd>PackerCompile<cr>", "Compile" }, - i = { "<cmd>PackerInstall<cr>", "Install" }, - r = { "<cmd>lua require('cfg.utils').reload_config()<cr>", "Reload" }, - s = { "<cmd>PackerSync<cr>", "Sync" }, - u = { "<cmd>PackerUpdate<cr>", "Update" }, - }, - g = { - name = "Git", - j = { "<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk" }, - k = { "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", "Prev Hunk" }, - l = { "<cmd>lua require 'gitsigns'.blame_line()<cr>", "Blame" }, - p = { "<cmd>lua require 'gitsigns'.preview_hunk()<cr>", "Preview Hunk" }, - r = { "<cmd>lua require 'gitsigns'.reset_hunk()<cr>", "Reset Hunk" }, - R = { "<cmd>lua require 'gitsigns'.reset_buffer()<cr>", "Reset Buffer" }, - s = { "<cmd>lua require 'gitsigns'.stage_hunk()<cr>", "Stage Hunk" }, - u = { - "<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>", - "Undo Stage Hunk", - }, - o = { "<cmd>Telescope git_status<cr>", "Open changed file" }, - b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" }, - c = { "<cmd>Telescope git_commits<cr>", "Checkout commit" }, - C = { - "<cmd>Telescope git_bcommits<cr>", - "Checkout commit(for current file)", - }, - }, - l = { - name = "LSP", - a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Code Action" }, - d = { - "<cmd>Telescope lsp_document_diagnostics<cr>", - "Document Diagnostics", - }, - w = { - "<cmd>Telescope lsp_workspace_diagnostics<cr>", - "Workspace Diagnostics", - }, - f = { "<cmd>Neoformat<cr>", "Format" }, - i = { "<cmd>LspInfo<cr>", "Info" }, - j = { "<cmd>lua vim.lsp.diagnostic.goto_next({popup_opts = {border = O.lsp.popup_border}})<cr>", "Next Diagnostic" }, - k = { "<cmd>lua vim.lsp.diagnostic.goto_prev({popup_opts = {border = O.lsp.popup_border}})<cr>", "Prev Diagnostic" }, - q = { "<cmd>Telescope quickfix<cr>", "Quickfix" }, - r = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" }, - s = { - O.plugin.symbol_outline.active and "<cmd>SymbolsOutline<cr>" or "<cmd> Telescope lsp_document_symbols<cr>", - "Document Symbols", - }, - S = { - "<cmd>Telescope lsp_dynamic_workspace_symbols<cr>", - "Workspace Symbols", - }, - }, - s = { - name = "Search", - b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" }, - c = { "<cmd>Telescope colorscheme<cr>", "Colorscheme" }, - d = { "<cmd>Telescope commands<cr>", "Commands History" }, - f = { "<cmd>Telescope find_files<cr>", "Find File" }, - h = { "<cmd>Telescope help_tags<cr>", "Find Help" }, - M = { "<cmd>Telescope man_pages<cr>", "Man Pages" }, - r = { "<cmd>Telescope oldfiles<cr>", "Open Recent File" }, - R = { "<cmd>Telescope registers<cr>", "Registers" }, - t = { "<cmd>Telescope live_grep<cr>", "Text" }, - }, - T = { - name = "Treesitter", - i = { ":TSConfigInfo<cr>", "Info" }, - }, -} - -if O.plugin.symbol_outline.active then - vim.api.nvim_set_keymap("n", "<leader>o", ":SymbolsOutline<CR>", { noremap = true, silent = true }) - mappings["o"] = "Symbols outline" -end - -if O.plugin.ts_playground.active then - vim.api.nvim_set_keymap("n", "<leader>Th", ":TSHighlightCapturesUnderCursor<CR>", { noremap = true, silent = true }) - mappings[""] = "Highlight Capture" -end - -if O.plugin.zen.active then - vim.api.nvim_set_keymap("n", "<leader>z", ":ZenMode<CR>", { noremap = true, silent = true }) - mappings["z"] = "Zen" -end - -if O.plugin.telescope_project.active then - -- open projects - vim.api.nvim_set_keymap( - "n", - "<leader>P", - ":lua require'telescope'.extensions.project.project{}<CR>", - { noremap = true, silent = true } - ) - mappings["P"] = "Projects" -end - -if O.lushmode then - mappings["L"] = { - name = "+Lush", - l = { ":Lushify<cr>", "Lushify" }, - x = { ":lua require('lush').export_to_buffer(require('lush_theme.cool_name'))", "Lush Export" }, - t = { ":LushRunTutorial<cr>", "Lush Tutorial" }, - q = { ":LushRunQuickstart<cr>", "Lush Quickstart" }, - } -end - -for k, v in pairs(O.user_which_key) do - mappings[k] = v -end - -local wk = require "which-key" -wk.register(mappings, opts) diff --git a/.config/nvim/lua/cfg/zen/init.lua b/.config/nvim/lua/cfg/zen/init.lua deleted file mode 100644 index d4a3da5..0000000 --- a/.config/nvim/lua/cfg/zen/init.lua +++ /dev/null @@ -1,30 +0,0 @@ -local M = {} -local status_ok, zen_mode = pcall(require, "zen-mode") -if not status_ok then - return -end - -M.config = function() - zen_mode.setup { - window = { - backdrop = 1, - height = 0.85, -- height of the Zen window - options = { - signcolumn = "no", -- disable signcolumn - number = false, -- disable number column - relativenumber = false, -- disable relative numbers - -- cursorline = false, -- disable cursorline - -- cursorcolumn = false, -- disable cursor column - -- foldcolumn = "0", -- disable fold column - -- list = false, -- disable whitespace characters - }, - }, - plugins = { - gitsigns = { enabled = false }, -- disables git signs - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - }, - } -end -return M |