diff --git a/.aliases b/.aliases index 78fface..bd57054 100644 --- a/.aliases +++ b/.aliases @@ -32,6 +32,7 @@ alias ta="todo.sh add" alias tl="todo.sh list" alias td="todo.sh do" alias tp="todo.sh pri" +alias vim="nvim" alias viz="vim ~/.zshrc" alias vit="vim ~/.tmux.conf" alias vip="vim ~/.p10k.zsh" diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..00b1530 --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,36 @@ +CONFIG_PATH = vim.fn.stdpath('config') +DATA_PATH = vim.fn.stdpath('data') +CACHE_PATH = vim.fn.stdpath('cache') +TERMINAL = vim.fn.expand('$TERMINAL') + +-- load all plugins +require "pluginList" +require "misc-utils" +require "top-bufferline" + +local g = vim.g + +g.mapleader = " " +g.auto_save = false + +-- colorscheme related stuff + +g.nvchad_theme = "onedark" +local base16 = require "base16" +base16(base16.themes["onedark"], true) + +require "highlights" +require "mappings" +require "file-icons" +require "statusline" +require "which-key-nvim" + +-- hide line numbers , statusline in specific buffers! +vim.api.nvim_exec( + [[ + au BufEnter term://* setlocal nonumber + au BufEnter,BufWinEnter,WinEnter,CmdwinEnter * if bufname('%') == "NvimTree" | set laststatus=0 | else | set laststatus=2 | endif + au BufEnter term://* set laststatus=0 +]], + false +) diff --git a/.config/nvim/lua/compe-completion.lua b/.config/nvim/lua/compe-completion.lua new file mode 100644 index 0000000..259098b --- /dev/null +++ b/.config/nvim/lua/compe-completion.lua @@ -0,0 +1,38 @@ +local M = {} + +M.config = function() + require "compe".setup { + enabled = true, + 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 = { + buffer = {kind = "﬘", true}, + luasnip = {kind = "﬌", true}, + nvim_lsp = true, + nvim_lua = true, + } + } +end + +M.snippets = function() + local ls = require("luasnip") + + ls.config.set_config( + { + history = true, + updateevents = "TextChanged,TextChangedI" + } + ) + require("luasnip/loaders/from_vscode").load() +end + +return M diff --git a/.config/nvim/lua/dashboard.lua b/.config/nvim/lua/dashboard.lua new file mode 100644 index 0000000..d53a90f --- /dev/null +++ b/.config/nvim/lua/dashboard.lua @@ -0,0 +1,42 @@ +local M = {} + +M.config = function() + local g = vim.g + + g.dashboard_disable_at_vimenter = 0 -- dashboard is disabled by default + g.dashboard_disable_statusline = 1 + g.dashboard_default_executive = "telescope" + g.dashboard_custom_header = { + " ", + " ", + " ", + " ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ", + " ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ", + " ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ", + " ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ", + " ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ", + " ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ", + " ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ", + " ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ", + " ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ", + " ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ", + " ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ", + " " + } + + g.dashboard_custom_section = { + a = {description = {" Find File SPC f f"}, command = "Telescope find_files"}, + b = {description = {" Recents SPC f o"}, command = "Telescope oldfiles"}, + c = {description = {" Find Word SPC f w"}, command = "Telescope live_grep"}, + d = {description = {"洛 New File SPC f n"}, command = "DashboardNewFile"}, + e = {description = {" Bookmarks SPC b m"}, command = "Telescope marks"}, + f = {description = {" Load Last Session SPC s l"}, command = "SessionLoad"} + } + + g.dashboard_custom_footer = { + " ", + "NvChad v0.5" + } +end + +return M diff --git a/.config/nvim/lua/file-icons.lua b/.config/nvim/lua/file-icons.lua new file mode 100644 index 0000000..3b16c21 --- /dev/null +++ b/.config/nvim/lua/file-icons.lua @@ -0,0 +1,117 @@ +local global_theme = "themes/" .. vim.g.nvchad_theme +local colors = require(global_theme) + +require "nvim-web-devicons".setup { + override = { + html = { + icon = "", + color = colors.baby_pink, + name = "html" + }, + css = { + icon = "", + color = colors.blue, + name = "css" + }, + js = { + icon = "", + color = colors.sun, + name = "js" + }, + ts = { + icon = "ﯤ", + color = colors.teal, + name = "ts" + }, + kt = { + icon = "󱈙", + color = colors.orange, + name = "kt" + }, + png = { + icon = "", + color = colors.dark_purple, + name = "png" + }, + jpg = { + icon = "", + color = colors.dark_purple, + name = "jpg" + }, + jpeg = { + icon = "", + color = "colors.dark_purple", + name = "jpeg" + }, + mp3 = { + icon = "", + color = colors.white, + name = "mp3" + }, + mp4 = { + icon = "", + color = colors.white, + name = "mp4" + }, + out = { + icon = "", + color = colors.white, + name = "out" + }, + Dockerfile = { + icon = "", + color = colors.cyan, + name = "Dockerfile" + }, + rb = { + icon = "", + color = colors.pink, + name = "rb" + }, + vue = { + icon = "﵂", + color = colors.vibrant_green, + name = "vue" + }, + py = { + icon = "", + color = colors.cyan, + name = "py" + }, + toml = { + icon = "", + color = colors.blue, + name = "toml" + }, + lock = { + icon = "", + color = colors.red, + name = "lock" + }, + zip = { + icon = "", + color = colors.sun, + name = "zip" + }, + xz = { + icon = "", + color = colors.sun, + name = "xz" + }, + deb = { + icon = "", + color = colors.cyan, + name = "deb" + }, + rpm = { + icon = "", + color = colors.orange, + name = "rpm" + }, + lua = { + icon = "", + color = colors.blue, + name = "lua" + } + } +} diff --git a/.config/nvim/lua/gitsigns-nvim.lua b/.config/nvim/lua/gitsigns-nvim.lua new file mode 100644 index 0000000..85973e2 --- /dev/null +++ b/.config/nvim/lua/gitsigns-nvim.lua @@ -0,0 +1,33 @@ +local M = {} + +M.config = function() + require("gitsigns").setup { + signs = { + add = {hl = "DiffAdd", text = "▌", numhl = "GitSignsAddNr"}, + change = {hl = "DiffChange", text = "▌", numhl = "GitSignsChangeNr"}, + delete = {hl = "DiffDelete", text = "_", numhl = "GitSignsDeleteNr"}, + topdelete = {hl = "DiffDelete", text = "‾", numhl = "GitSignsDeleteNr"}, + changedelete = {hl = "DiffChange", text = "~", numhl = "GitSignsChangeNr"} + }, + numhl = false, + keymaps = { + -- Default keymap options + noremap = true, + buffer = true, + ["n ]c"] = {expr = true, '&diff ? \']c\' : \'lua require"gitsigns".next_hunk()\''}, + ["n [c"] = {expr = true, '&diff ? \'[c\' : \'lua require"gitsigns".prev_hunk()\''}, + ["n hs"] = 'lua require"gitsigns".stage_hunk()', + ["n hu"] = 'lua require"gitsigns".undo_stage_hunk()', + ["n hr"] = 'lua require"gitsigns".reset_hunk()', + ["n hp"] = 'lua require"gitsigns".preview_hunk()', + ["n hb"] = 'lua require"gitsigns".blame_line()' + }, + watch_index = { + interval = 100 + }, + sign_priority = 5, + status_formatter = nil -- Use default + } +end + +return M diff --git a/.config/nvim/lua/highlights.lua b/.config/nvim/lua/highlights.lua new file mode 100644 index 0000000..e276211 --- /dev/null +++ b/.config/nvim/lua/highlights.lua @@ -0,0 +1,145 @@ +local cmd = vim.cmd + +local global_theme = "themes/" .. vim.g.nvchad_theme +local colors = require(global_theme) + +local white = colors.white +local darker_black = colors.darker_black +local black = colors.black +local black2 = colors.black2 +local one_bg = colors.one_bg +local one_bg2 = colors.one_bg2 +local one_bg3 = colors.one_bg3 +local light_grey = colors.light_grey +local grey = colors.grey +local grey_fg = colors.grey_fg +local red = colors.red +local line = colors.line +local green = colors.green +local nord_blue = colors.nord_blue +local blue = colors.blue +local yellow = colors.yellow +local purple = colors.purple + +-- for guifg , bg + +local function fg(group, color) + cmd("hi " .. group .. " guifg=" .. color) +end + +local function bg(group, color) + cmd("hi " .. group .. " guibg=" .. color) +end + +local function fg_bg(group, fgcol, bgcol) + cmd("hi " .. group .. " guifg=" .. fgcol .. " guibg=" .. bgcol) +end + +-- blankline + +fg("IndentBlanklineChar", line) + +-- misc -- +fg("LineNr", grey) +fg("Comment", grey) +fg("NvimInternalError", red) +fg("VertSplit", line) +fg("EndOfBuffer", black) + +-- Pmenu +bg("Pmenu", one_bg) +bg("PmenuSbar", one_bg2) +bg("PmenuSel", green) +bg("PmenuThumb", nord_blue) + +-- inactive statuslines as thin splitlines +cmd("hi! StatusLineNC gui=underline guifg=" .. line) + +-- line n.o +cmd "hi clear CursorLine" +fg("cursorlinenr", white) + +-- git signs --- +fg_bg("DiffAdd", nord_blue, "none") +fg_bg("DiffChange", one_bg2, "none") +fg_bg("DiffModified", nord_blue, "none") + +-- NvimTree +fg("NvimTreeFolderIcon", blue) +fg("NvimTreeFolderName", blue) +fg("NvimTreeOpenedFolderName", blue) +fg("NvimTreeEmptyFolderName", blue) +fg("NvimTreeIndentMarker", one_bg2) +fg("NvimTreeVertSplit", darker_black) +bg("NvimTreeVertSplit", darker_black) +fg("NvimTreeEndOfBuffer", darker_black) + +fg("NvimTreeRootFolder", darker_black) +bg("NvimTreeNormal", darker_black) +fg_bg("NvimTreeStatuslineNc", darker_black, darker_black) +fg_bg("NvimTreeWindowPicker", red, black2) + +-- telescope +fg("TelescopeBorder", line) +fg("TelescopePromptBorder", line) +fg("TelescopeResultsBorder", line) +fg("TelescopePreviewBorder", grey) + +-- LspDiagnostics --- + +-- error / warnings +fg("LspDiagnosticsSignError", red) +fg("LspDiagnosticsVirtualTextError", red) +fg("LspDiagnosticsSignWarning", yellow) +fg("LspDiagnosticsVirtualTextWarning", yellow) + +-- info +fg("LspDiagnosticsSignInformation", green) +fg("LspDiagnosticsVirtualTextInformation", green) + +-- hint +fg("LspDiagnosticsSignHint", purple) +fg("LspDiagnosticsVirtualTextHint", purple) + +-- bufferline + +fg_bg("BufferLineFill", grey_fg, black2) +fg_bg("BufferLineBackground", light_grey, black2) + +fg_bg("BufferLineBufferVisible", light_grey, black2) +fg_bg("BufferLineBufferSelected", white, black) + +cmd "hi BufferLineBufferSelected gui=bold" + +-- tabs +fg_bg("BufferLineTab", light_grey, one_bg3) +fg_bg("BufferLineTabSelected", black2, nord_blue) +fg_bg("BufferLineTabClose", red, black) + +fg_bg("BufferLineIndicator", black2, black2) +fg_bg("BufferLineIndicatorSelected", black, black) + +-- separators +fg_bg("BufferLineSeparator", black2, black2) +fg_bg("BufferLineSeparatorVisible", black2, black2) +fg_bg("BufferLineSeparatorSelected", black, black2) + +-- modified buffers +fg_bg("BufferLineModified", red, black2) +fg_bg("BufferLineModifiedVisible", red, black2) +fg_bg("BufferLineModifiedSelected", green, black) + +-- close buttons +fg_bg("BufferLineCLoseButtonVisible", light_grey, black2) +fg_bg("BufferLineCLoseButton", light_grey, black2) +fg_bg("BufferLineCLoseButtonSelected", red, black) + +-- dashboard + +fg("DashboardHeader", grey_fg) +fg("DashboardCenter", grey_fg) +fg("DashboardShortcut", grey_fg) +fg("DashboardFooter", grey_fg) + +-- Default nvim bg (based on terminal bg) +-- cmd "hi Normal guibg=#1e222a" diff --git a/.config/nvim/lua/java.lua b/.config/nvim/lua/java.lua new file mode 100644 index 0000000..2600856 --- /dev/null +++ b/.config/nvim/lua/java.lua @@ -0,0 +1,13 @@ +local on_attach = function(client, bufr) + -- require('jdtls').setup_dap() + require'lsp'.common_on_attach(client, bufr) +end + +require'lspconfig'.jdtls.setup { + on_attach = on_attach, + cmd = {DATA_PATH .. "/lspinstall/java/jdtls.sh"}, + filetypes = { "java" }, + root_dir = util.root_pattern({'.git', 'build.gradle', 'pom.xml'}), + -- init_options = {bundles = bundles} + -- on_attach = require'lsp'.common_on_attach +} diff --git a/.config/nvim/lua/mappings.lua b/.config/nvim/lua/mappings.lua new file mode 100644 index 0000000..bd38bab --- /dev/null +++ b/.config/nvim/lua/mappings.lua @@ -0,0 +1,134 @@ +local function map(mode, lhs, rhs, opts) + local options = {noremap = true, silent = true} + if opts then + options = vim.tbl_extend("force", options, opts) + end + vim.api.nvim_set_keymap(mode, lhs, rhs, options) +end + +local opt = {} + +-- dont copy any deleted text , this is disabled by default so uncomment the below mappings if you want them +--[[ remove this line + +map("n", "dd", [=[ "_dd ]=], opt) +map("v", "dd", [=[ "_dd ]=], opt) +map("v", "x", [=[ "_x ]=], opt) + + this line too ]] +-- + +-- OPEN TERMINALS -- +-- map("n", "", [[vnew term://zsh ]], opt) -- term over right +-- map("n", "", [[ split term://zsh | resize 10 ]], opt) -- term bottom +-- map("n", "t", [[ tabnew | term ]], opt) -- term newtab + +-- swap ` and ' +map("n", "`", "'", opt) +map("n", "'", '`', opt) + +-- copy whole file content +map("n", "", [[ %y+]], opt) + +-- toggle relative number +map("n", "", ":set invrelativenumber", opt) + +map("n", "", ":w ", opt) + + +-- map("n", "", ":bpspbnbd! ", opt) +map("i", "kj", "`^", opt) +map("i", "jk", "`^", opt) + +-- copy till end of line +map("n", "Y", "y$", opt) + +-- select previously changed or yanked text +map("n", "gm", "`[v`]", opt) + +-- go to the next matching parenthesis +map("n", "gp", "%", opt) + + +-- compe stuff + +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 + +_G.tab_complete = function() + if vim.fn.pumvisible() == 1 then + return t "" + elseif check_back_space() then + return t "" + else + return vim.fn["compe#complete"]() + end +end + +_G.s_tab_complete = function() + if vim.fn.pumvisible() == 1 then + return t "" + elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then + return t "(vsnip-jump-prev)" + else + return t "" + end +end + +function _G.completions() + local npairs = require("nvim-autopairs") + if vim.fn.pumvisible() == 1 then + if vim.fn.complete_info()["selected"] ~= -1 then + return vim.fn["compe#confirm"]("") + end + end + return npairs.check_break_line_char() +end +-- compe mappings +map("i", "", "v:lua.tab_complete()", {expr = true}) +map("s", "", "v:lua.tab_complete()", {expr = true}) +map("i", "", "v:lua.s_tab_complete()", {expr = true}) +map("s", "", "v:lua.s_tab_complete()", {expr = true}) +map("i", "", "v:lua.completions()", {expr = true}) + +-- nvimtree +map("n", "'", ":NvimTreeToggle", opt) + +-- map("n", "fn", [[ DashboardNewFile]], opt) +-- map("n", "bm", [[ DashboardJumpMarks]], opt) +-- map("n", "l", [[ SessionLoad]], opt) +-- map("n", "s", [[ SessionSave]], opt) + +-- Telescope +-- map("n", "gt", [[ Telescope git_status ]], opt) +-- map("n", "cm", [[ Telescope git_commits ]], opt) +-- map("n", "fp", [[lua require('telescope').extensions.media_files.media_files()]], opt) +-- map("n", "fb", [[Telescope buffers]], opt) +-- map("n", "fh", [[Telescope help_tags]], opt) +-- map("n", "fo", [[Telescope oldfiles]], opt) + +-- bufferline tab stuff +map("n", "", ":tabnew", opt) -- new tab +map("n", "", ":bd!", opt) -- close tab + +-- indent with tabs +map("n", "", '>>', opt) +map("n", "", '<<', opt) +map("v", "", '>>', opt) +map("v", "", '<<', opt) + + +map("n", "", ":set invhlsearch", opt) +-- move around *visually* +map("n", "j", "gj", opt) +map("n", "k", "gk", opt) diff --git a/.config/nvim/lua/misc-utils.lua b/.config/nvim/lua/misc-utils.lua new file mode 100644 index 0000000..d91bcdd --- /dev/null +++ b/.config/nvim/lua/misc-utils.lua @@ -0,0 +1,72 @@ +local opt = vim.opt + +opt.ruler = false +opt.undofile = true +opt.undodir = "/home/sahin/.local/share/nvim/undo" +opt.backupdir = "/home/sahin/.local/share/nvim/backup" +opt.backup = true +-- opt.hidden = true +opt.ignorecase = true +opt.splitbelow = true +opt.splitright = true +opt.termguicolors = true +opt.cul = true +opt.mouse = "a" +opt.signcolumn = "yes" +opt.cmdheight = 1 +opt.updatetime = 250 -- update interval for gitsigns +opt.clipboard = "unnamedplus" +opt.scrolloff = 2 + +-- Numbers +opt.number = true +opt.relativenumber=true +opt.numberwidth = 2 +-- opt("w", "relativenumber", true) + +-- for indenline +opt.expandtab = true +opt.shiftwidth = 2 +opt.smartindent = true + +-- disable builtin vim plugins +vim.g.loaded_gzip = 0 +vim.g.loaded_tar = 0 +vim.g.loaded_tarPlugin = 0 +vim.g.loaded_zipPlugin = 0 +vim.g.loaded_2html_plugin = 0 +vim.g.loaded_netrw = 0 +vim.g.loaded_netrwPlugin = 0 +vim.g.loaded_matchit = 0 +vim.g.loaded_matchparen = 0 +vim.g.loaded_spec = 0 + +local M = {} + +function M.is_buffer_empty() + -- Check whether the current buffer is empty + return vim.fn.empty(vim.fn.expand("%:t")) == 1 +end + +function M.has_width_gt(cols) + -- Check if the windows width is greater than a given number of columns + return vim.fn.winwidth(0) / 2 > cols +end + +-- file extension specific tabbing +-- vim.cmd([[autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4]]) + +-- blankline config + +M.blankline = function() + vim.g.indentLine_enabled = 1 + vim.g.indent_blankline_char = "▏" + + vim.g.indent_blankline_filetype_exclude = {"help", "terminal", "dashboard"} + vim.g.indent_blankline_buftype_exclude = {"terminal"} + + vim.g.indent_blankline_show_trailing_blankline_indent = false + vim.g.indent_blankline_show_first_indent_level = false +end + +return M diff --git a/.config/nvim/lua/nvim-lspconfig.lua b/.config/nvim/lua/nvim-lspconfig.lua new file mode 100644 index 0000000..d5ee63c --- /dev/null +++ b/.config/nvim/lua/nvim-lspconfig.lua @@ -0,0 +1,102 @@ +local M = {} + +M.config = function() + function on_attach(client, bufnr) + local function buf_set_keymap(...) + vim.api.nvim_buf_set_keymap(bufnr, ...) + end + local function buf_set_option(...) + vim.api.nvim_buf_set_option(bufnr, ...) + end + + buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") + + -- Mappings. + local opts = {noremap = true, silent = true} + + buf_set_keymap("n", "gD", "lua vim.lsp.buf.declaration()", opts) + buf_set_keymap("n", "gd", "lua vim.lsp.buf.definition()", opts) + buf_set_keymap("n", "K", "lua vim.lsp.buf.hover()", opts) + buf_set_keymap("n", "gi", "lua vim.lsp.buf.implementation()", opts) + -- buf_set_keymap("n", "", "lua vim.lsp.buf.signature_help()", opts) + buf_set_keymap("n", "wa", "lua vim.lsp.buf.add_workspace_folder()", opts) + buf_set_keymap("n", "wr", "lua vim.lsp.buf.remove_workspace_folder()", opts) + buf_set_keymap("n", "wl", "lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))", opts) + buf_set_keymap("n", "D", "lua vim.lsp.buf.type_definition()", opts) + buf_set_keymap("n", "rn", "lua vim.lsp.buf.rename()", opts) + buf_set_keymap("n", "gr", "lua vim.lsp.buf.references()", opts) + buf_set_keymap("n", "e", "lua vim.lsp.diagnostic.show_line_diagnostics()", opts) + buf_set_keymap("n", "[d", "lua vim.lsp.diagnostic.goto_prev()", opts) + buf_set_keymap("n", "]d", "lua vim.lsp.diagnostic.goto_next()", opts) + buf_set_keymap("n", "q", "lua vim.lsp.diagnostic.set_loclist()", opts) + + -- Set some keybinds conditional on server capabilities + -- if client.resolved_capabilities.document_formatting then + -- buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) + -- elseif client.resolved_capabilities.document_range_formatting then + -- buf_set_keymap("n", "f", "lua vim.lsp.buf.range_formatting()", opts) + -- end + end + + -- lspInstall + lspconfig stuff + -- config that activates keymaps and enables snippet support + local function make_config() + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities.textDocument.completion.completionItem.snippetSupport = true + return { + -- enable snippet support + capabilities = capabilities, + -- map buffer local keybindings when the language server attaches + on_attach = on_attach, + } + end + local function setup_servers() + require "lspinstall".setup() + local lspconf = require("lspconfig") + local servers = require "lspinstall".installed_servers() + for _, server in pairs(servers) do + if server ~= "lua" then + lspconf[server].setup { + on_attach = on_attach, + root_dir = vim.loop.cwd + } + elseif server == "lua" then + lspconf[server].setup { + root_dir = vim.loop.cwd, + settings = { + Lua = { + diagnostics = { + globals = {"vim"} + }, + workspace = { + library = { + [vim.fn.expand("$VIMRUNTIME/lua")] = true, + [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true + } + }, + telemetry = { + enable = false + } + } + } + } + end + end + end + + setup_servers() + + -- Automatically reload after `:LspInstall ` so we don't have to restart neovim + require "lspinstall".post_install_hook = function() + setup_servers() -- reload installed servers + vim.cmd("bufdo e") -- triggers FileType autocmd that starts the server + end + + -- replace the default lsp diagnostic letters with prettier symbols + vim.fn.sign_define("LspDiagnosticsSignError", {text = "", numhl = "LspDiagnosticsDefaultError"}) + vim.fn.sign_define("LspDiagnosticsSignWarning", {text = "", numhl = "LspDiagnosticsDefaultWarning"}) + vim.fn.sign_define("LspDiagnosticsSignInformation", {text = "", numhl = "LspDiagnosticsDefaultInformation"}) + vim.fn.sign_define("LspDiagnosticsSignHint", {text = "", numhl = "LspDiagnosticsDefaultHint"}) +end + +return M diff --git a/.config/nvim/lua/nvimTree.lua b/.config/nvim/lua/nvimTree.lua new file mode 100644 index 0000000..17be5f7 --- /dev/null +++ b/.config/nvim/lua/nvimTree.lua @@ -0,0 +1,101 @@ +local M = {} + +M.config = function() + local g = vim.g + + vim.o.termguicolors = true + + g.nvim_tree_side = "left" + -- g.nvim_tree_width = 25 + g.nvim_tree_ignore = {".git", "node_modules", ".cache"} + g.nvim_tree_gitignore = 0 + -- g.nvim_tree_auto_ignore_ft = {"dashboard", "startify"} -- don't open tree on specific fiypes. + g.nvim_tree_auto_open = 1 + g.nvim_tree_auto_close = 0 -- closes tree when it's the last window + g.nvim_tree_quit_on_open = 0 -- closes tree when file's opened + 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_highlight_opened_files = 1 + g.nvim_tree_root_folder_modifier = ":t" + g.nvim_tree_tab_open = 0 + g.nvim_tree_allow_resize = 1 + g.nvim_tree_add_trailing = 1 -- append a trailing slash to folder names + g.nvim_tree_disable_netrw = 1 + g.nvim_tree_hijack_netrw = 0 + g.nvim_tree_update_cwd = 1 + + g.nvim_tree_show_icons = { + git = 1, + folders = 1, + files = 1 + -- folder_arrows= 1 + } + g.nvim_tree_icons = { + default = "", + symlink = "", + git = { + unstaged = "✗", + staged = "✓", + unmerged = "", + renamed = "➜", + untracked = "★", + deleted = "", + ignored = "◌" + }, + folder = { + -- disable indent_markers option to get arrows working or if you want both arrows and indent then just add the arrow icons in front ofthe default and opened folders below! + -- arrow_open = "", + -- arrow_closed = "", + default = "", + open = "", + empty = "", + empty_open = "", + symlink = "", + symlink_open = "" + } + } + + local tree_cb = require "nvim-tree.config".nvim_tree_callback + + g.nvim_tree_bindings = { + -- {key = {"", "o", "<2-LeftMouse>"}, cb = tree_cb("edit")}, + -- {key = {"<2-RightMouse>", ""}, cb = tree_cb("cd")}, + -- {key = "", cb = tree_cb("vsplit")}, + -- {key = "", cb = tree_cb("split")}, + -- {key = "", cb = tree_cb("tabnew")}, + -- {key = "<", cb = tree_cb("prev_sibling")}, + -- {key = ">", cb = tree_cb("next_sibling")}, + -- {key = "P", cb = tree_cb("parent_node")}, + -- {key = "", cb = tree_cb("close_node")}, + -- {key = "", cb = tree_cb("close_node")}, + -- {key = "", cb = tree_cb("preview")}, + -- {key = "K", cb = tree_cb("first_sibling")}, + -- {key = "J", cb = tree_cb("last_sibling")}, + -- {key = "I", cb = tree_cb("toggle_ignored")}, + -- {key = "H", cb = tree_cb("toggle_dotfiles")}, + -- {key = "R", cb = tree_cb("refresh")}, + -- {key = "a", cb = tree_cb("create")}, + -- {key = "d", cb = tree_cb("remove")}, + -- {key = "r", cb = tree_cb("rename")}, + {key = "", cb = tree_cb("full_rename")}, + -- {key = "x", cb = tree_cb("cut")}, + -- {key = "c", cb = tree_cb("copy")}, + -- {key = "p", cb = tree_cb("paste")}, + -- {key = "y", cb = tree_cb("copy_name")}, + -- {key = "Y", cb = tree_cb("copy_path")}, + -- {key = "gy", cb = tree_cb("copy_absolute_path")}, + -- {key = "[c", cb = tree_cb("prev_git_item")}, + -- {key = "}c", cb = tree_cb("next_git_item")}, + -- {key = "-", cb = tree_cb("dir_up")}, + -- {key = "q", cb = tree_cb("close")}, + {key = {"l", "", "o"}, cb = tree_cb("edit")}, + {key = "h", cb = tree_cb("close_node")}, + {key = "v", cb = tree_cb("vsplit")}, + {key = "s", cb = tree_cb("split")}, + {key = "?", cb = tree_cb("toggle_help")} + } +end + +return M diff --git a/.config/nvim/lua/pluginList.lua b/.config/nvim/lua/pluginList.lua new file mode 100644 index 0000000..0029523 --- /dev/null +++ b/.config/nvim/lua/pluginList.lua @@ -0,0 +1,198 @@ +local packer = require("packer") +local use = packer.use + +return packer.startup( + function() + use "wbthomason/packer.nvim" + -- -migrated from my vimrc + use "christoomey/vim-tmux-navigator" + use 'tpope/vim-repeat' + use 'tpope/vim-surround' + use 'tpope/vim-unimpaired' + use 'tpope/vim-fugitive' + use 'tpope/vim-abolish' + + use {'ms-jpq/chadtree', branch='chad', run="python3 -m chadtree deps"} + + use "akinsho/nvim-bufferline.lua" + use "glepnir/galaxyline.nvim" + + -- color related stuff + use "siduck76/nvim-base16.lua" + use "folke/which-key.nvim" + + use { + "norcalli/nvim-colorizer.lua", + event = "BufRead", + config = function() + require("colorizer").setup() + vim.cmd("ColorizerReloadAllBuffers") + end + } + + -- language related plugins + use { + "nvim-treesitter/nvim-treesitter", + event = "BufRead", + config = function() + require("treesitter-nvim").config() + end + } + + use { + "neovim/nvim-lspconfig", + event = "BufRead", + config = function() + require("nvim-lspconfig").config() + end + } + + use "kabouzeid/nvim-lspinstall" + use {"mfussenegger/nvim-jdtls"} + use "glepnir/lspsaga.nvim" + + use { + "onsails/lspkind-nvim", + event = "BufRead", + config = function() + require("lspkind").init() + + end + } + + -- load compe in insert mode only + use { + "hrsh7th/nvim-compe", + event = "InsertEnter", + config = function() + require("compe-completion").config() + end, + wants = {"LuaSnip"}, + requires = { + { + "L3MON4D3/LuaSnip", + wants = "friendly-snippets", + event = "InsertCharPre", + config = function() + require("compe-completion").snippets() + end + }, + "rafamadriz/friendly-snippets" + } + } + + use {"sbdchd/neoformat", cmd = "Neoformat"} + + -- file managing , picker etc + use { + "kyazdani42/nvim-tree.lua", + cmd = "NvimTreeToggle", + config = function() + require("nvimTree").config() + end + } + + use "kyazdani42/nvim-web-devicons" + use 'gruvbox-community/gruvbox' + use { + "nvim-telescope/telescope.nvim", + requires = { + {"nvim-lua/popup.nvim"}, + {"nvim-lua/plenary.nvim"}, + {"nvim-telescope/telescope-fzf-native.nvim", run = "make"}, + {"nvim-telescope/telescope-media-files.nvim"} + }, + cmd = "Telescope", + config = function() + require("telescope-nvim").config() + end + } + + -- git stuff + use { + "lewis6991/gitsigns.nvim", + event = "BufRead", + config = function() + require("gitsigns-nvim").config() + end + } + + -- misc plugins + use { + "windwp/nvim-autopairs", + event = "InsertEnter", + config = function() + require("nvim-autopairs").setup() + end + } + + use {"andymass/vim-matchup", event = "CursorMoved"} + + use { + "terrortylor/nvim-comment", + cmd = "CommentToggle", + config = function() + require("nvim_comment").setup() + end + } + + use { + "glepnir/dashboard-nvim", + cmd = { + "Dashboard", + "DashboardNewFile", + "DashboardJumpMarks", + "SessionLoad", + "SessionSave" + }, + setup = function() + require("dashboard").config() + end + } + + use {"tweekmonster/startuptime.vim", cmd = "StartupTime"} + + -- load autosave only if its globally enabled + use { + "Pocco81/AutoSave.nvim", + config = function() + require("zenmode").autoSave() + end, + cond = function() + return vim.g.auto_save == true + end + } + + -- smooth scroll + use { + "karb94/neoscroll.nvim", + event = "WinScrolled", + config = function() + require("neoscroll").setup() + end + } + + use { + "Pocco81/TrueZen.nvim", + cmd = {"TZAtaraxis", "TZMinimalist", "TZFocus"}, + config = function() + require("zenmode").config() + end + } + + -- use "alvan/vim-closetag" -- for html autoclosing tag + + use { + "lukas-reineke/indent-blankline.nvim", + event = "BufRead", + setup = function() + require("misc-utils").blankline() + end + } + end, + { + display = { + border = {"┌", "─", "┐", "│", "┘", "─", "└", "│"} + } + } +) diff --git a/.config/nvim/lua/statusline.lua b/.config/nvim/lua/statusline.lua new file mode 100644 index 0000000..ea45845 --- /dev/null +++ b/.config/nvim/lua/statusline.lua @@ -0,0 +1,207 @@ +local gl = require("galaxyline") +local gls = gl.section +local condition = require("galaxyline.condition") + +gl.short_line_list = {" "} + +local global_theme = "themes/" .. vim.g.nvchad_theme +local colors = require(global_theme) + +gls.left[1] = { + FirstElement = { + provider = function() + return "▋" + end, + highlight = {colors.nord_blue, colors.nord_blue} + } +} + +gls.left[2] = { + statusIcon = { + provider = function() + return "  " + end, + highlight = {colors.statusline_bg, colors.nord_blue}, + separator = " ", + separator_highlight = {colors.nord_blue, colors.lightbg} + } +} + +gls.left[3] = { + FileIcon = { + provider = "FileIcon", + condition = condition.buffer_not_empty, + highlight = {colors.white, colors.lightbg} + } +} + +gls.left[4] = { + FileName = { + provider = {"FileName"}, + condition = condition.buffer_not_empty, + highlight = {colors.white, colors.lightbg}, + separator = " ", + separator_highlight = {colors.lightbg, colors.lightbg2} + } +} + +gls.left[5] = { + current_dir = { + provider = function() + local dir_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":t") + return "  " .. dir_name .. " " + end, + highlight = {colors.grey_fg2, colors.lightbg2}, + separator = " ", + separator_highlight = {colors.lightbg2, colors.statusline_bg} + } +} + +local checkwidth = function() + local squeeze_width = vim.fn.winwidth(0) / 2 + if squeeze_width > 30 then + return true + end + return false +end + +gls.left[6] = { + DiffAdd = { + provider = "DiffAdd", + condition = checkwidth, + icon = "  ", + highlight = {colors.white, colors.statusline_bg} + } +} + +gls.left[7] = { + DiffModified = { + provider = "DiffModified", + condition = checkwidth, + icon = "  ", + highlight = {colors.grey_fg2, colors.statusline_bg} + } +} + +gls.left[8] = { + DiffRemove = { + provider = "DiffRemove", + condition = checkwidth, + icon = "  ", + highlight = {colors.grey_fg2, colors.statusline_bg} + } +} + +gls.left[9] = { + DiagnosticError = { + provider = "DiagnosticError", + icon = "  ", + highlight = {colors.red, colors.statusline_bg} + } +} + +gls.left[10] = { + DiagnosticWarn = { + provider = "DiagnosticWarn", + icon = "  ", + highlight = {colors.yellow, colors.statusline_bg} + } +} + +gls.right[1] = { + lsp_status = { + provider = function() + local clients = vim.lsp.get_active_clients() + if next(clients) ~= nil then + return " " .. "  " .. " LSP " + else + return "" + end + end, + highlight = {colors.grey_fg2, colors.statusline_bg} + } +} + +gls.right[2] = { + GitIcon = { + provider = function() + return " " + end, + condition = require("galaxyline.condition").check_git_workspace, + highlight = {colors.grey_fg2, colors.statusline_bg}, + separator = " ", + separator_highlight = {colors.statusline_bg, colors.statusline_bg} + } +} + +gls.right[3] = { + GitBranch = { + provider = "GitBranch", + condition = require("galaxyline.condition").check_git_workspace, + highlight = {colors.grey_fg2, colors.statusline_bg} + } +} + +gls.right[4] = { + viMode_icon = { + provider = function() + return " " + end, + highlight = {colors.statusline_bg, colors.red}, + separator = " ", + separator_highlight = {colors.red, colors.statusline_bg} + } +} + +gls.right[5] = { + ViMode = { + provider = function() + local alias = { + n = "Normal", + i = "Insert", + c = "Command", + V = "Visual", + [""] = "Visual", + v = "Visual", + R = "Replace" + } + local current_Mode = alias[vim.fn.mode()] + + if current_Mode == nil then + return " Terminal " + else + return " " .. current_Mode .. " " + end + end, + highlight = {colors.red, colors.lightbg} + } +} + +gls.right[6] = { + some_icon = { + provider = function() + return " " + end, + separator = "", + separator_highlight = {colors.green, colors.lightbg}, + highlight = {colors.lightbg, colors.green} + } +} + +gls.right[7] = { + line_percentage = { + provider = function() + local current_line = vim.fn.line(".") + local total_line = vim.fn.line("$") + + if current_line == 1 then + return " Top " + elseif current_line == vim.fn.line("$") then + return " Bot " + end + local result, _ = math.modf((current_line / total_line) * 100) + return " " .. result .. "% " + end, + highlight = {colors.green, colors.lightbg} + } +} diff --git a/.config/nvim/lua/telescope-nvim.lua b/.config/nvim/lua/telescope-nvim.lua new file mode 100644 index 0000000..c18b19a --- /dev/null +++ b/.config/nvim/lua/telescope-nvim.lua @@ -0,0 +1,70 @@ +local M = {} + +M.config = function() + require("telescope").setup { + defaults = { + vimgrep_arguments = { + "rg", + "--color=never", + "--no-heading", + "--with-filename", + "--line-number", + "--column", + "--smart-case" + }, + prompt_prefix = "  ", + selection_caret = " ", + entry_prefix = " ", + initial_mode = "insert", + selection_strategy = "reset", + sorting_strategy = "descending", + layout_strategy = "horizontal", + layout_config = { + horizontal = { + prompt_position = "top", + preview_width = 0.55, + results_width = 0.8 + }, + vertical = { + mirror = false + }, + width = 0.87, + height = 0.80, + preview_cutoff = 120 + }, + file_sorter = require "telescope.sorters".get_fuzzy_file, + file_ignore_patterns = {}, + generic_sorter = require "telescope.sorters".get_generic_fuzzy_sorter, + shorten_path = true, + 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 + }, + extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = false, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case" -- or "ignore_case" or "respect_case" + -- the default case_mode is "smart_case" + }, + media_files = { + filetypes = {"png", "webp", "jpg", "jpeg"}, + find_cmd = "rg" -- find command (defaults to `fd`) + } + } + } + + require("telescope").load_extension("fzf") + require("telescope").load_extension("media_files") +end + +return M diff --git a/.config/nvim/lua/themes/gruvbox.lua b/.config/nvim/lua/themes/gruvbox.lua new file mode 100644 index 0000000..415e858 --- /dev/null +++ b/.config/nvim/lua/themes/gruvbox.lua @@ -0,0 +1,33 @@ +local colors = { + white = "#c7b89d", + darker_black = "#1e2122", + black = "#222526", -- nvim bg + black2 = "#26292a", + one_bg = "#2b2e2f", + one_bg2 = "#2f3233", + one_bg3 = "#313435", + grey = "#46494a", + grey_fg = "#5d6061", + grey_fg2 = "#5b5e5f", + light_grey = "#585b5c", + red = "#ec6b64", + baby_pink = "#ce8196", + pink = "#ff75a0", + line = "#2c2f30", -- for lines like vertsplit + green = "#89b482", + vibrant_green = "#a9b665", + nord_blue = "#6f8faf", + blue = "#6d8dad", + yellow = "#d6b676", + sun = "#d1b171", + purple = "#b4bbc8", + dark_purple = "#cc7f94", + teal = "#749689", + orange = "#e78a4e", + cyan = "#82b3a8", + statusline_bg = "#252829", + lightbg = "#2d3139", + lightbg2 = "#262a32" +} + +return colors diff --git a/.config/nvim/lua/themes/onedark.lua b/.config/nvim/lua/themes/onedark.lua new file mode 100644 index 0000000..02d7d43 --- /dev/null +++ b/.config/nvim/lua/themes/onedark.lua @@ -0,0 +1,33 @@ +local colors = { + white = "#abb2bf", + darker_black = "#1b1f27", + black = "#1e222a", -- nvim bg + black2 = "#252931", + one_bg = "#282c34", -- real bg of onedark + one_bg2 = "#353b45", + one_bg3 = "#30343c", + grey = "#42464e", + grey_fg = "#565c64", + grey_fg2 = "#6f737b", + light_grey = "#6f737b", + red = "#d47d85", + baby_pink = "#DE8C92", + pink = "#ff75a0", + line = "#2a2e36", -- for lines like vertsplit + green = "#A3BE8C", + vibrant_green = "#7eca9c", + nord_blue = "#81A1C1", + blue = "#61afef", + yellow = "#e7c787", + sun = "#EBCB8B", + purple = "#b4bbc8", + dark_purple = "#c882e7", + teal = "#519ABA", + orange = "#fca2aa", + cyan = "#a3b8ef", + statusline_bg = "#22262e", + lightbg = "#2d3139", + lightbg2 = "#262a32" +} + +return colors diff --git a/.config/nvim/lua/top-bufferline.lua b/.config/nvim/lua/top-bufferline.lua new file mode 100644 index 0000000..eb56214 --- /dev/null +++ b/.config/nvim/lua/top-bufferline.lua @@ -0,0 +1,19 @@ +require "bufferline".setup { + options = { + offsets = {{filetype = "NvimTree", text = "", padding = 1}}, + buffer_close_icon = "", + modified_icon = "", + close_icon = "", + left_trunc_marker = "", + right_trunc_marker = "", + max_name_length = 14, + max_prefix_length = 13, + tab_size = 20, + show_tab_indicators = true, + enforce_regular_tabs = false, + view = "multiwindow", + show_buffer_close_icons = true, + separator_style = "thin", + mappings = "true" + } +} diff --git a/.config/nvim/lua/treesitter-nvim.lua b/.config/nvim/lua/treesitter-nvim.lua new file mode 100644 index 0000000..754fe7f --- /dev/null +++ b/.config/nvim/lua/treesitter-nvim.lua @@ -0,0 +1,27 @@ +local M = {} + +M.config = function() + local ts_config = require("nvim-treesitter.configs") + + ts_config.setup { + ensure_installed = { + "javascript", + "html", + "css", + "bash", + "lua", + "json", + "c", + "python", + "java", + -- "rust", + -- "go" + }, + highlight = { + enable = true, + use_languagetree = true + } + } +end + +return M diff --git a/.config/nvim/lua/which-key-nvim.lua b/.config/nvim/lua/which-key-nvim.lua new file mode 100644 index 0000000..e42d059 --- /dev/null +++ b/.config/nvim/lua/which-key-nvim.lua @@ -0,0 +1,354 @@ +require("which-key").setup { + plugins = { + marks = true, -- shows a list of your marks on ' and ` + registers = true, -- shows your registers on " in NORMAL or 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 + 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 = {"", "", "", "", "call", "lua", "^:", "^ "}, -- hide mapping boilerplate + show_help = true -- show help message on the command line when the popup is visible +} + + +local function map(mode, lhs, rhs, opts) + local options = {noremap = true, silent = true} + if opts then + options = vim.tbl_extend("force", options, opts) + end + vim.api.nvim_set_keymap(mode, lhs, rhs, options) +end + +local opt = {} +-- Set leader +-- if O.leader_key == ' ' or O.leader_key == 'space' then + map('n', '', '', opt) + -- vim.api.nvim_set_keymap('n', '', '', + -- {noremap = true, silent = true}) + vim.g.mapleader = ' ' +-- else + -- vim.api.nvim_set_keymap('n', O.leader_key, '', + -- {noremap = true, silent = true}) + -- vim.g.mapleader = O.leader_key +-- end + +local opts = { + mode = "n", -- NORMAL mode + prefix = "", + 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 +} + +-- cycle tabs +map("n", "n", [[BufferLineCycleNext]], opt) +map("n", "p", [[BufferLineLineCyclePrev]], opt) + +-- Truezen.nvim +map("n", "z", ":TZAtaraxis", opt) +map("n", "m", ":TZMinimalist", opt) +map("n", "j", ":TZFocus", opt) + + +-- no hl +vim.api.nvim_set_keymap('n', 'h', ':let @/=""', + {noremap = true, silent = true}) + +-- explorer +map("n", "e", ":NvimTreeToggle", opt) + +-- TODO this introduces some bugs unfortunately +-- vim.api.nvim_set_keymap('n', 'e', +-- ":lua require'lv-nvimtree'.toggle_tree()", +-- {noremap = true, silent = true}) +-- vim.api.nvim_set_keymap('n', 'e', +-- ":NvimTreeToggle", +-- {noremap = true, silent = true}) + +-- telescope or snap +-- if O.plugin.snap.active then + -- vim.api.nvim_set_keymap('n', 'f', ':Snap find_files', + -- {noremap = true, silent = true}) +-- else + vim.api.nvim_set_keymap('n', 'f', ':Telescope find_files', + {noremap = true, silent = true}) +-- end + +-- dashboard +vim.api.nvim_set_keymap('n', ';', ':Dashboard', + {noremap = true, silent = true}) + +-- Comments +map("v", "/", ":CommentToggle", opt) + +-- dashboard +map("n", ";", [[ Dashboard]], opt) + +-- TODO create entire treesitter section + +local mappings = { + + ["/"] = {":CommentToggle", "Comment"}, + [''] = {'', 'alternate file'}, + -- ["e"] = "Explorer", + -- + + -- ["c"]= {":BufferClose", "Close Buffer"}, + ["f"] = "Find File", + ["h"] = "No Highlight", + ['\\'] = { ':vnew', 'vsplit'}, + ['-'] = { ':new', 'hsplit'}, + b = { + name = "Buffers", + j = {"BufferLinePick", "jump to buffer"}, + -- f = {O.plugin.snap.active and "Snap buffers" or "Telescope buffers", "Find buffer"}, + f = {"Telescope buffers", "Find buffer"}, + w = {"BufferLineWipeout", "wipeout buffer"}, + h = {"BufferLineCloseBuffersLeft", "close all buffers to the left"}, + l = { + "BufferLineCloseBuffersRight", + "close all BufferLines to the right" + }, + D = { + "BufferLineOrderByDirectory", + "sort BufferLines automatically by directory" + }, + L = { + "BufferLineOrderByLanguage", + "sort BufferLines automatically by language" + } + }, + + -- diagnostics vanilla nvim + -- -- diagnostic + -- function lv_utils.get_all() + -- vim.lsp.diagnostic.get_all() + -- end + -- function lv_utils.get_next() + -- vim.lsp.diagnostic.get_next() + -- end + -- function lv_utils.get_prev() + -- vim.lsp.diagnostic.get_prev() + -- end + -- function lv_utils.goto_next() + -- vim.lsp.diagnostic.goto_next() + -- end + -- function lv_utils.goto_prev() + -- vim.lsp.diagnostic.goto_prev() + -- end + -- function lv_utils.show_line_diagnostics() + -- vim.lsp.diagnostic.show_line_diagnostics() + -- end + + -- " Available Debug Adapters: + -- " https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/ + -- " Adapter configuration and installation instructions: + -- " https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation + -- " Debug Adapter protocol: + -- " https://microsoft.github.io/debug-adapter-protocol/ + -- " Debugging + -- command! DebugToggleBreakpoint lua require'dap'.toggle_breakpoint() + -- command! DebugStart lua require'dap'.continue() + -- command! DebugContinue lua require'dap'.continue() + -- command! DebugStepOver lua require'dap'.step_over() + -- command! DebugStepOut lua require'dap'.step_out() + -- command! DebugStepInto lua require'dap'.step_into() + -- command! DebugToggleRepl lua require'dap'.repl.toggle() + -- command! DebugGetSession lua require'dap'.session() + -- D = { + -- name = "Debug", + -- b = {"DebugToggleBreakpoint", "Toggle Breakpoint"}, + -- c = {"DebugContinue", "Continue"}, + -- i = {"DebugStepInto", "Step Into"}, + -- o = {"DebugStepOver", "Step Over"}, + -- r = {"DebugToggleRepl", "Toggle Repl"}, + -- s = {"DebugStart", "Start"} + -- }, + g = { + name = "Git", + j = {"lua require 'gitsigns'.next_hunk()", "Next Hunk"}, + k = {"lua require 'gitsigns'.prev_hunk()", "Prev Hunk"}, + l = {"lua require 'gitsigns'.blame_line()", "Blame"}, + p = {"lua require 'gitsigns'.preview_hunk()", "Preview Hunk"}, + r = {"lua require 'gitsigns'.reset_hunk()", "Reset Hunk"}, + R = {"lua require 'gitsigns'.reset_buffer()", "Reset Buffer"}, + s = {"lua require 'gitsigns'.stage_hunk()", "Stage Hunk"}, + u = { + "lua require 'gitsigns'.undo_stage_hunk()", + "Undo Stage Hunk" + }, + o = {"Telescope git_status", "Open changed file"}, + b = {"Telescope git_branches", "Checkout branch"}, + c = {"Telescope git_commits", "Checkout commit"}, + C = { + "Telescope git_bcommits", + "Checkout commit(for current file)" + } + }, + l = { + name = "LSP", + a = {"Lspsaga code_action", "Code Action"}, + A = {"Lspsaga range_code_action", "Selected Action"}, + d = { + "Telescope lsp_document_diagnostics", + "Document Diagnostics" + }, + D = { + "Telescope lsp_workspace_diagnostics", + "Workspace Diagnostics" + }, + f = {"lua vim.lsp.buf.formatting()", "Format"}, + h = {"Lspsaga hover_doc", "Hover Doc"}, + i = {"LspInfo", "Info"}, + j = {"Lspsaga diagnostic_jump_prev", "Prev Diagnostic"}, + k = {"Lspsaga diagnostic_jump_next", "Next Diagnostic"}, + l = {"Lspsaga lsp_finder", "LSP Finder"}, + L = {"Lspsaga show_line_diagnostics", "Line Diagnostics"}, + p = {"Lspsaga preview_definition", "Preview Definition"}, + q = {"Telescope quickfix", "Quickfix"}, + r = {"Lspsaga rename", "Rename"}, + t = {"LspTypeDefinition", "Type Definition"}, + x = {"cclose", "Close Quickfix"}, + s = {" Telescope lsp_document_symbols", "Document Symbols"}, + -- s = {O.plugin.symbol_outline.active and "SymbolsOutline" or + -- " Telescope lsp_document_symbols", "Document Symbols"}, + S = { + "Telescope lsp_dynamic_workspace_symbols", + "Workspace Symbols" + } + }, + s = { + name = "Search", + b = {"Telescope git_branches", "Checkout branch"}, + c = {"Telescope colorscheme", "Colorscheme"}, + -- d = { + -- "Telescope lsp_document_diagnostics", + -- "Document Diagnostics" + -- }, + -- D = { + -- "Telescope lsp_workspace_diagnostics", + -- "Workspace Diagnostics" + -- }, + f = {"Telescope find_files", "Find File"}, + -- f = {O.plugin.snap.active and "Snap find_files" or "Telescope find_files", "Find File"}, + h = {"Telescope help_tags", "Find Help"}, + -- m = {"Telescope marks", "Marks"}, + M = {"Telescope man_pages", "Man Pages"}, + r = {"Telescope oldfiles", "Open Recent File"}, + -- r = {O.plugin.snap.active and "Snap oldfiles" or "Telescope oldfiles", "Open Recent File"}, + R = {"Telescope registers", "Registers"}, + t = {"Telescope live_grep", "Text"} + -- t = {O.plugin.snap.active and "Snap live_grep" or "Telescope live_grep", "Text"} + }, + S = { + name = "Session", + s = {"SessionSave", "Save Session"}, + l = {"SessionLoad", "Load Session"} + }, + T = { + name = "Treesitter", + i = {":TSConfigInfo", "Info"} + } +} + + +-- if O.plugin.spectre.active then +-- mappings['r'] = { +-- name = "Replace", +-- f = { +-- "lua require('spectre').open_file_search()", "Current File" +-- }, +-- p = {"lua require('spectre').open()", "Project"} +-- } +-- end +-- +-- if O.plugin.trouble.active then +-- mappings['d'] = { +-- name = "Diagnostics", +-- t = {"TroubleToggle", "trouble"}, +-- w = {"TroubleToggle lsp_workspace_diagnostics", "workspace"}, +-- d = {"TroubleToggle lsp_document_diagnostics", "document"}, +-- q = {"TroubleToggle quickfix", "quickfix"}, +-- l = {"TroubleToggle loclist", "loclist"}, +-- r = {"TroubleToggle lsp_references", "references"} +-- } +-- end +-- +-- if O.plugin.gitlinker.active then mappings["gy"] = "Gitlink" end +-- +-- if O.plugin.ts_playground.active then +-- vim.api.nvim_set_keymap("n", "Th", +-- ":TSHighlightCapturesUnderCursor", +-- {noremap = true, silent = true}) +-- mappings[""] = "Highlight Capture" +-- end +-- +-- if O.plugin.zen.active then +-- vim.api.nvim_set_keymap("n", "z", ":ZenMode", +-- {noremap = true, silent = true}) +-- mappings["z"] = "Zen" +-- end +-- if O.plugin.lazygit.active then +-- vim.api.nvim_set_keymap("n", "gg", ":LazyGit", +-- {noremap = true, silent = true}) +-- mappings["gg"] = "LazyGit" +-- end +-- if O.plugin.telescope_project.active then +-- -- open projects +-- vim.api.nvim_set_keymap('n', 'p', +-- ":lua require'telescope'.extensions.project.project{}", +-- {noremap = true, silent = true}) +-- mappings["p"] = "Projects" +-- end +-- +-- -- [";"] = "Dashboard", +-- +-- if O.lang.latex.active then +-- mappings["L"] = { +-- name = "+Latex", +-- c = {"VimtexCompile", "Toggle Compilation Mode"}, +-- f = {"call vimtex#fzf#run()", "Fzf Find"}, +-- i = {"VimtexInfo", "Project Information"}, +-- s = {"VimtexStop", "Stop Project Compilation"}, +-- t = {"VimtexTocToggle", "Toggle Table Of Content"}, +-- v = {"VimtexView", "View PDF"} +-- } +-- end +-- +-- if O.lushmode then +-- mappings["L"] = { +-- name = "+Lush", +-- l = {":Lushify", "Lushify"}, +-- x = {":lua require('lush').export_to_buffer(require('lush_theme.cool_name'))", "Lush Export"}, +-- t = {":LushRunTutorial", "Lush Tutorial"}, +-- q = {":LushRunQuickstart", "Lush Quickstart"} +-- } +-- end + +local wk = require("which-key") +wk.register(mappings, opts) diff --git a/.config/nvim/lua/zenmode.lua b/.config/nvim/lua/zenmode.lua new file mode 100644 index 0000000..e98c535 --- /dev/null +++ b/.config/nvim/lua/zenmode.lua @@ -0,0 +1,76 @@ +-- plugins made by @Pocco81 =) + +local M = {} + +M.config = function() + local true_zen = require("true-zen") + + true_zen.setup( + { + true_false_commands = false, + cursor_by_mode = false, + before_minimalist_mode_shown = true, + before_minimalist_mode_hidden = true, + after_minimalist_mode_shown = true, + after_minimalist_mode_hidden = true, + bottom = { + hidden_laststatus = 0, + hidden_ruler = false, + hidden_showmode = false, + hidden_showcmd = false, + hidden_cmdheight = 1, + shown_laststatus = 2, + shown_ruler = true, + shown_showmode = false, + shown_showcmd = false, + shown_cmdheight = 1 + }, + top = { + hidden_showtabline = 0, + shown_showtabline = 2 + }, + left = { + hidden_number = false, + hidden_relativenumber = false, + hidden_signcolumn = "no", + shown_number = true, + shown_relativenumber = false, + shown_signcolumn = "yes" + }, + ataraxis = { + just_do_it_for_me = false, + left_padding = 37, + right_padding = 37, + top_padding = 2, + bottom_padding = 2, + custome_bg = "#1e222a" + }, + integrations = { + integration_galaxyline = true + } + } + ) +end + +-- autosave.nvim plugin disabled by default +M.autoSave = function() + local autosave = require("autosave") + + autosave.setup( + { + enabled = vim.g.auto_save, -- takes boolean value from init.lua + execution_message = "autosaved at : " .. vim.fn.strftime("%H:%M:%S"), + events = {"InsertLeave", "TextChanged"}, + conditions = { + exists = true, + filetype_is_not = {}, + modifiable = true + }, + write_all_buffers = true, + on_off_commands = true, + clean_command_line_interval = 2500 + } + ) +end + +return M diff --git a/.config/nvim/plugin/packer_compiled.lua b/.config/nvim/plugin/packer_compiled.lua new file mode 100644 index 0000000..feccef9 --- /dev/null +++ b/.config/nvim/plugin/packer_compiled.lua @@ -0,0 +1,342 @@ +-- Automatically generated packer.nvim plugin loader code + +if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then + vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') + return +end + +vim.api.nvim_command('packadd packer.nvim') + +local no_errors, error_msg = pcall(function() + + local time + local profile_info + local should_profile = false + if should_profile then + local hrtime = vim.loop.hrtime + profile_info = {} + time = function(chunk, start) + if start then + profile_info[chunk] = hrtime() + else + profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 + end + end + else + time = function(chunk, start) end + end + +local function save_profiles(threshold) + local sorted_times = {} + for chunk_name, time_taken in pairs(profile_info) do + sorted_times[#sorted_times + 1] = {chunk_name, time_taken} + end + table.sort(sorted_times, function(a, b) return a[2] > b[2] end) + local results = {} + for i, elem in ipairs(sorted_times) do + if not threshold or threshold and elem[2] > threshold then + results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' + end + end + + _G._packer = _G._packer or {} + _G._packer.profile_output = results +end + +time([[Luarocks path setup]], true) +local package_path_str = "/home/sahin/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/sahin/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/sahin/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/sahin/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" +local install_cpath_pattern = "/home/sahin/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" +if not string.find(package.path, package_path_str, 1, true) then + package.path = package.path .. ';' .. package_path_str +end + +if not string.find(package.cpath, install_cpath_pattern, 1, true) then + package.cpath = package.cpath .. ';' .. install_cpath_pattern +end + +time([[Luarocks path setup]], false) +time([[try_loadstring definition]], true) +local function try_loadstring(s, component, name) + local success, result = pcall(loadstring(s)) + if not success then + vim.schedule(function() + vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) + end) + end + return result +end + +time([[try_loadstring definition]], false) +time([[Defining packer_plugins]], true) +_G.packer_plugins = { + ["AutoSave.nvim"] = { + config = { "\27LJ\2\n8\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\rautoSave\fzenmode\frequire\0" }, + loaded = false, + needs_bufread = false, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/AutoSave.nvim" + }, + LuaSnip = { + config = { "\27LJ\2\nA\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\rsnippets\21compe-completion\frequire\0" }, + loaded = false, + needs_bufread = false, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/LuaSnip", + wants = { "friendly-snippets" } + }, + ["TrueZen.nvim"] = { + commands = { "TZAtaraxis", "TZMinimalist", "TZFocus" }, + config = { "\27LJ\2\n6\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\vconfig\fzenmode\frequire\0" }, + loaded = false, + needs_bufread = false, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/TrueZen.nvim" + }, + chadtree = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/chadtree" + }, + ["dashboard-nvim"] = { + commands = { "Dashboard", "DashboardNewFile", "DashboardJumpMarks", "SessionLoad", "SessionSave" }, + loaded = false, + needs_bufread = false, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/dashboard-nvim" + }, + ["friendly-snippets"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/friendly-snippets" + }, + ["galaxyline.nvim"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/galaxyline.nvim" + }, + ["gitsigns.nvim"] = { + config = { "\27LJ\2\n<\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\vconfig\18gitsigns-nvim\frequire\0" }, + loaded = false, + needs_bufread = false, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/gitsigns.nvim" + }, + gruvbox = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/gruvbox" + }, + ["indent-blankline.nvim"] = { + loaded = false, + needs_bufread = false, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/indent-blankline.nvim" + }, + ["lspkind-nvim"] = { + config = { "\27LJ\2\n4\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\tinit\flspkind\frequire\0" }, + loaded = false, + needs_bufread = false, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/lspkind-nvim" + }, + ["lspsaga.nvim"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/lspsaga.nvim" + }, + neoformat = { + commands = { "Neoformat" }, + loaded = false, + needs_bufread = false, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/neoformat" + }, + ["neoscroll.nvim"] = { + config = { "\27LJ\2\n7\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\14neoscroll\frequire\0" }, + loaded = false, + needs_bufread = false, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/neoscroll.nvim" + }, + ["nvim-autopairs"] = { + config = { "\27LJ\2\n<\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0" }, + loaded = false, + needs_bufread = false, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/nvim-autopairs" + }, + ["nvim-base16.lua"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/nvim-base16.lua" + }, + ["nvim-bufferline.lua"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/nvim-bufferline.lua" + }, + ["nvim-colorizer.lua"] = { + config = { "\27LJ\2\ni\0\0\3\0\6\0\n6\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\0016\0\3\0009\0\4\0'\2\5\0B\0\2\1K\0\1\0\30ColorizerReloadAllBuffers\bcmd\bvim\nsetup\14colorizer\frequire\0" }, + loaded = false, + needs_bufread = false, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/nvim-colorizer.lua" + }, + ["nvim-comment"] = { + commands = { "CommentToggle" }, + config = { "\27LJ\2\n:\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\17nvim_comment\frequire\0" }, + loaded = false, + needs_bufread = false, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/nvim-comment" + }, + ["nvim-compe"] = { + after_files = { "/home/sahin/.local/share/nvim/site/pack/packer/opt/nvim-compe/after/plugin/compe.vim" }, + config = { "\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\vconfig\21compe-completion\frequire\0" }, + loaded = false, + needs_bufread = false, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/nvim-compe", + wants = { "LuaSnip" } + }, + ["nvim-jdtls"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/nvim-jdtls" + }, + ["nvim-lspconfig"] = { + config = { "\27LJ\2\n=\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\vconfig\19nvim-lspconfig\frequire\0" }, + loaded = false, + needs_bufread = false, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/nvim-lspconfig" + }, + ["nvim-lspinstall"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/nvim-lspinstall" + }, + ["nvim-tree.lua"] = { + commands = { "NvimTreeToggle" }, + config = { "\27LJ\2\n7\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\vconfig\rnvimTree\frequire\0" }, + loaded = false, + needs_bufread = false, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/nvim-tree.lua" + }, + ["nvim-treesitter"] = { + config = { "\27LJ\2\n>\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\vconfig\20treesitter-nvim\frequire\0" }, + loaded = false, + needs_bufread = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/nvim-treesitter" + }, + ["nvim-web-devicons"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/nvim-web-devicons" + }, + ["packer.nvim"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/packer.nvim" + }, + ["plenary.nvim"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/plenary.nvim" + }, + ["popup.nvim"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/popup.nvim" + }, + ["startuptime.vim"] = { + commands = { "StartupTime" }, + loaded = false, + needs_bufread = false, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/startuptime.vim" + }, + ["telescope-fzf-native.nvim"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/telescope-fzf-native.nvim" + }, + ["telescope-media-files.nvim"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/telescope-media-files.nvim" + }, + ["telescope.nvim"] = { + commands = { "Telescope" }, + config = { "\27LJ\2\n=\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\vconfig\19telescope-nvim\frequire\0" }, + loaded = false, + needs_bufread = false, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/telescope.nvim" + }, + ["vim-abolish"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/vim-abolish" + }, + ["vim-fugitive"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/vim-fugitive" + }, + ["vim-matchup"] = { + after_files = { "/home/sahin/.local/share/nvim/site/pack/packer/opt/vim-matchup/after/plugin/matchit.vim" }, + loaded = false, + needs_bufread = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/opt/vim-matchup" + }, + ["vim-repeat"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/vim-repeat" + }, + ["vim-surround"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/vim-surround" + }, + ["vim-tmux-navigator"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/vim-tmux-navigator" + }, + ["vim-unimpaired"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/vim-unimpaired" + }, + ["which-key.nvim"] = { + loaded = true, + path = "/home/sahin/.local/share/nvim/site/pack/packer/start/which-key.nvim" + } +} + +time([[Defining packer_plugins]], false) +-- Setup for: indent-blankline.nvim +time([[Setup for indent-blankline.nvim]], true) +try_loadstring("\27LJ\2\n<\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\14blankline\15misc-utils\frequire\0", "setup", "indent-blankline.nvim") +time([[Setup for indent-blankline.nvim]], false) +-- Setup for: dashboard-nvim +time([[Setup for dashboard-nvim]], true) +try_loadstring("\27LJ\2\n8\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\vconfig\14dashboard\frequire\0", "setup", "dashboard-nvim") +time([[Setup for dashboard-nvim]], false) +-- Conditional loads +time("Condition for { 'AutoSave.nvim' }", true) +if +try_loadstring("\27LJ\2\n;\0\0\1\0\3\0\t6\0\0\0009\0\1\0009\0\2\0\n\0\2\0X\0\2+\0\1\0X\1\1+\0\2\0L\0\2\0\14auto_save\6g\bvim\0", "condition", '{ "AutoSave.nvim" }') +then +time("Condition for { 'AutoSave.nvim' }", false) +time([[packadd for AutoSave.nvim]], true) + vim.cmd [[packadd AutoSave.nvim]] + time([[packadd for AutoSave.nvim]], false) + -- Config for: AutoSave.nvim + time([[Config for AutoSave.nvim]], true) + try_loadstring("\27LJ\2\n8\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\rautoSave\fzenmode\frequire\0", "config", "AutoSave.nvim") + time([[Config for AutoSave.nvim]], false) +else +time("Condition for { 'AutoSave.nvim' }", false) +end + +-- Command lazy-loads +time([[Defining lazy-load commands]], true) +vim.cmd [[command! -nargs=* -range -bang -complete=file NvimTreeToggle lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeToggle", l1 = , l2 = , bang = , args = }, _G.packer_plugins)]] +vim.cmd [[command! -nargs=* -range -bang -complete=file CommentToggle lua require("packer.load")({'nvim-comment'}, { cmd = "CommentToggle", l1 = , l2 = , bang = , args = }, _G.packer_plugins)]] +vim.cmd [[command! -nargs=* -range -bang -complete=file Telescope lua require("packer.load")({'telescope.nvim'}, { cmd = "Telescope", l1 = , l2 = , bang = , args = }, _G.packer_plugins)]] +vim.cmd [[command! -nargs=* -range -bang -complete=file Dashboard lua require("packer.load")({'dashboard-nvim'}, { cmd = "Dashboard", l1 = , l2 = , bang = , args = }, _G.packer_plugins)]] +vim.cmd [[command! -nargs=* -range -bang -complete=file DashboardNewFile lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardNewFile", l1 = , l2 = , bang = , args = }, _G.packer_plugins)]] +vim.cmd [[command! -nargs=* -range -bang -complete=file DashboardJumpMarks lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardJumpMarks", l1 = , l2 = , bang = , args = }, _G.packer_plugins)]] +vim.cmd [[command! -nargs=* -range -bang -complete=file SessionLoad lua require("packer.load")({'dashboard-nvim'}, { cmd = "SessionLoad", l1 = , l2 = , bang = , args = }, _G.packer_plugins)]] +vim.cmd [[command! -nargs=* -range -bang -complete=file SessionSave lua require("packer.load")({'dashboard-nvim'}, { cmd = "SessionSave", l1 = , l2 = , bang = , args = }, _G.packer_plugins)]] +vim.cmd [[command! -nargs=* -range -bang -complete=file TZFocus lua require("packer.load")({'TrueZen.nvim'}, { cmd = "TZFocus", l1 = , l2 = , bang = , args = }, _G.packer_plugins)]] +vim.cmd [[command! -nargs=* -range -bang -complete=file TZMinimalist lua require("packer.load")({'TrueZen.nvim'}, { cmd = "TZMinimalist", l1 = , l2 = , bang = , args = }, _G.packer_plugins)]] +vim.cmd [[command! -nargs=* -range -bang -complete=file StartupTime lua require("packer.load")({'startuptime.vim'}, { cmd = "StartupTime", l1 = , l2 = , bang = , args = }, _G.packer_plugins)]] +vim.cmd [[command! -nargs=* -range -bang -complete=file TZAtaraxis lua require("packer.load")({'TrueZen.nvim'}, { cmd = "TZAtaraxis", l1 = , l2 = , bang = , args = }, _G.packer_plugins)]] +vim.cmd [[command! -nargs=* -range -bang -complete=file Neoformat lua require("packer.load")({'neoformat'}, { cmd = "Neoformat", l1 = , l2 = , bang = , args = }, _G.packer_plugins)]] +time([[Defining lazy-load commands]], false) + +vim.cmd [[augroup packer_load_aucmds]] +vim.cmd [[au!]] + -- Event lazy-loads +time([[Defining lazy-load event autocommands]], true) +vim.cmd [[au InsertEnter * ++once lua require("packer.load")({'nvim-compe', 'nvim-autopairs'}, { event = "InsertEnter *" }, _G.packer_plugins)]] +vim.cmd [[au BufRead * ++once lua require("packer.load")({'gitsigns.nvim', 'indent-blankline.nvim', 'nvim-colorizer.lua', 'nvim-lspconfig', 'nvim-treesitter', 'lspkind-nvim'}, { event = "BufRead *" }, _G.packer_plugins)]] +vim.cmd [[au CursorMoved * ++once lua require("packer.load")({'vim-matchup'}, { event = "CursorMoved *" }, _G.packer_plugins)]] +vim.cmd [[au WinScrolled * ++once lua require("packer.load")({'neoscroll.nvim'}, { event = "WinScrolled *" }, _G.packer_plugins)]] +vim.cmd [[au InsertCharPre * ++once lua require("packer.load")({'LuaSnip'}, { event = "InsertCharPre *" }, _G.packer_plugins)]] +time([[Defining lazy-load event autocommands]], false) +vim.cmd("augroup END") +if should_profile then save_profiles() end + +end) + +if not no_errors then + vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') +end