From 90b35e4ab0804bd896e8d413b09809dd5dfc343f Mon Sep 17 00:00:00 2001 From: Jas-SinghFSU Date: Fri, 15 Mar 2024 23:27:04 -0700 Subject: [PATCH] Add nvim back. --- nvim/README.md | 8 + nvim/init.lua | 1 + nvim/lazy-lock.json | 45 +++ nvim/lua/package-lock.json | 6 + nvim/lua/plugin_loader.lua | 588 +++++++++++++++++++++++++++++ nvim/lua/plugins/package-lock.json | 6 + nvim/lua/remap.lua | 74 ++++ nvim/lua/set.lua | 30 ++ nvim/package-lock.json | 6 + 9 files changed, 764 insertions(+) create mode 100644 nvim/README.md create mode 100644 nvim/init.lua create mode 100644 nvim/lazy-lock.json create mode 100644 nvim/lua/package-lock.json create mode 100644 nvim/lua/plugin_loader.lua create mode 100644 nvim/lua/plugins/package-lock.json create mode 100644 nvim/lua/remap.lua create mode 100644 nvim/lua/set.lua create mode 100644 nvim/package-lock.json diff --git a/nvim/README.md b/nvim/README.md new file mode 100644 index 0000000..6074c84 --- /dev/null +++ b/nvim/README.md @@ -0,0 +1,8 @@ +Thems the juicy dawt fyles + +The `~/.config/neovide/config.toml`: +```toml +[font] +normal = {family = "JetBrainsMono Nerd Font", style = "Medium"} +size = 15 +``` diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..ee7495d --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1 @@ +require('plugin_loader') \ No newline at end of file diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json new file mode 100644 index 0000000..eed99bd --- /dev/null +++ b/nvim/lazy-lock.json @@ -0,0 +1,45 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" }, + "bufferline.nvim": { "branch": "main", "commit": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "conform.nvim": { "branch": "master", "commit": "67ee2258e08ccb91345d52f62484b657feccef25" }, + "dashboard-nvim": { "branch": "master", "commit": "413442b12d85315fc626c44a0ce4929b213ef604" }, + "dracula.nvim": { "branch": "master", "commit": "611489ed7cab0e07c090397828e0e144e28a27f8" }, + "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" }, + "git-blame.nvim": { "branch": "master", "commit": "a0282d05adbee80aaf4e2ff35b81b52940b67bed" }, + "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, + "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, + "lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" }, + "lazygit.nvim": { "branch": "main", "commit": "774dcecbd0b9b57be6c150adacb60ced79b11b23" }, + "leetcode.nvim": { "branch": "master", "commit": "765cc76df77072e3ff4c3fdc256b9a244af73b6d" }, + "lsp-zero.nvim": { "branch": "v3.x", "commit": "14c9164413df4be17a5a0ca9e01a376691cbcaef" }, + "lsp_signature.nvim": { "branch": "master", "commit": "1b32f64549478efd8f9e0d00517db84cf41aa0ea" }, + "lualine.nvim": { "branch": "master", "commit": "af4c3cf17206810880d2a93562e0a4c0d901c684" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "82c7cb08ddb836ad938b2708e50085f12a8825d2" }, + "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, + "neoscroll.nvim": { "branch": "master", "commit": "21d52973bde32db998fc8b6590f87eb3c3c6d8e4" }, + "nui.nvim": { "branch": "main", "commit": "3dc46d725f7b94bee5117c0a699b57b1902b5d65" }, + "nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" }, + "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, + "nvim-lspconfig": { "branch": "master", "commit": "4bdd3800b4148f670c6cf55ef65f490148eeb550" }, + "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, + "nvim-tree.lua": { "branch": "master", "commit": "f7c09bd72e50e1795bd3afb9e2a2b157b4bfb3c3" }, + "nvim-treesitter": { "branch": "master", "commit": "f87882858438834d2fbb6379aa2be37de901751b" }, + "nvim-ufo": { "branch": "main", "commit": "2296dbb8939c4050c222f4eb24889540ef8acd76" }, + "nvim-web-devicons": { "branch": "master", "commit": "cb0c967c9723a76ccb1be0cc3a9a10e577d2f6ec" }, + "plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" }, + "pretty-fold.nvim": { "branch": "master", "commit": "a7d8b424abe0eedf50116c460fbe6dfd5783b1d5" }, + "promise-async": { "branch": "main", "commit": "93540c168c5ed2b030ec3e6c40ab8bbb85e36355" }, + "statuscol.nvim": { "branch": "main", "commit": "d954893262a57a92e46edd87de67e2b3fe72305e" }, + "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, + "todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" }, + "toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" }, + "vim-fugitive": { "branch": "master", "commit": "41beedabc7e948c787ea5696e04c3544c3674e23" } +} \ No newline at end of file diff --git a/nvim/lua/package-lock.json b/nvim/lua/package-lock.json new file mode 100644 index 0000000..577bd7d --- /dev/null +++ b/nvim/lua/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "lua", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/nvim/lua/plugin_loader.lua b/nvim/lua/plugin_loader.lua new file mode 100644 index 0000000..ba025fc --- /dev/null +++ b/nvim/lua/plugin_loader.lua @@ -0,0 +1,588 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system( + { "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", -- latest stable release + lazypath }) +end +vim.opt.rtp:prepend(lazypath) + +vim.g.mapleader = " " + +require('remap') +require('set') + +require('lazy').setup({ { + 'maxmx03/dracula.nvim', + config = function() + require("dracula").setup { + plugins = { + ["todo-comments.nvim"] = false, + ["indent-blankline.nvim"] = false + } + } + end +}, { + 'nvim-telescope/telescope.nvim', + tag = '0.1.5', + dependencies = { { 'nvim-lua/plenary.nvim' } }, + config = function() + local builtin = require('telescope.builtin') + local tele = require('telescope') + + tele.setup({ + "node_modules/.*", + "yarn.lock", + "package%-lock.json", + "lazy-lock.json", + "target/.*", + ".git/.*", + ".*/package%-lock.json", + }) + vim.keymap.set('n', 'pf', builtin.find_files, {}) + vim.keymap.set('n', '', builtin.git_files, {}) + vim.keymap.set('n', 'ps', function() + builtin.grep_string({ + search = vim.fn.input("Grep > ") + }); + end) + end +}, { + 'stevearc/conform.nvim', + opts = {}, + config = function() + require("conform").setup({ + formatters_by_ft = { + lua = { "stylua" }, + -- Conform will run multiple formatters sequentially + python = { "isort", "black" }, + -- Use a sub-list to run only the first available formatter + javascript = { { "prettierd", "prettier" } }, + javascriptreact = { { "prettierd", "prettier" } }, + }, + log_level = vim.log.levels.DEBUG + }) + vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" + end +},{ + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + build = "cd app && npm install", + init = function() + vim.g.mkdp_filetypes = { "markdown" } + -- vim.g.mkdp_browser = '/usr/share/applications/microsoft-edge.desktop' + end, + ft = { "markdown" }, +}, + { + 'nvim-treesitter/nvim-treesitter', + build = ':TSUpdate', + config = function() + require 'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { "javascript", "typescript", "c", "lua", "vim", "vimdoc", "query" }, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + + highlight = { + enable = true, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false + } + } + end + }, + { + 'nvim-tree/nvim-tree.lua', + dependencies = { 'nvim-tree/nvim-web-devicons' -- optional + }, + config = function() + -- disable netrw at the very start of your init.lua + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 + + -- optionally enable 24-bit colour + vim.opt.termguicolors = true + + -- empty setup using defaults + require("nvim-tree").setup() + end + }, { + 'ThePrimeagen/harpoon', + config = function() + local mark = require('harpoon.mark') + local ui = require('harpoon.ui') + + vim.keymap.set('n', 'a', mark.add_file) + vim.keymap.set('n', '', ui.toggle_quick_menu) + + vim.keymap.set('n', '1', function() + ui.nav_file(1) + end) + vim.keymap.set('n', '2', function() + ui.nav_file(2) + end) + vim.keymap.set('n', '3', function() + ui.nav_file(3) + end) + vim.keymap.set('n', '4', function() + ui.nav_file(4) + end) + vim.keymap.set('n', '5', function() + ui.nav_file(5) + end) + end +}, { + 'tpope/vim-fugitive', + config = function() + vim.keymap.set('n', 'gs', vim.cmd.Git) + end +}, -- + -- LSP Zero conf + -- + { + 'VonHeikemen/lsp-zero.nvim', + dependencies = { + "neovim/nvim-lspconfig", + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "hrsh7th/nvim-cmp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "saadparwaiz1/cmp_luasnip", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-nvim-lua", + "L3MON4D3/LuaSnip", + "rafamadriz/friendly-snippets", + }, + branch = 'v3.x', + config = function() + local lsp_zero = require('lsp-zero') + + lsp_zero.on_attach(function(_, bufnr) + local opts = { + buffer = bufnr, + remap = false + } + + vim.keymap.set("n", "gd", function() + vim.lsp.buf.definition() + end, opts) + vim.keymap.set("n", "K", function() + vim.lsp.buf.hover() + end, opts) + vim.keymap.set("n", "vws", function() + vim.lsp.buf.workspace_symbol() + end, opts) + vim.keymap.set("n", "vd", function() + vim.diagnostic.open_float() + end, opts) + vim.keymap.set("n", "[d", function() + vim.diagnostic.goto_next() + end, opts) + vim.keymap.set("n", "]d", function() + vim.diagnostic.goto_prev() + end, opts) + vim.keymap.set("n", "vca", function() + vim.lsp.buf.code_action() + end, opts) + vim.keymap.set("n", "vrr", function() + vim.lsp.buf.references() + end, opts) + vim.keymap.set("n", "vrn", function() + vim.lsp.buf.rename() + end, opts) + vim.keymap.set("i", "", function() + vim.lsp.buf.signature_help() + end, opts) + end) + + -- to learn how to use mason.nvim with lsp-zero + -- read this: https://github.com/VonHeikemen/lsp-zero.nvim/blob/v3.x/doc/md/guides/integrate-with-mason-nvim.md + require('mason').setup({}) + require('mason-lspconfig').setup({ + ensure_installed = { 'tsserver', 'eslint', 'lua_ls', 'rust_analyzer' }, + handlers = { + lsp_zero.default_setup, + lua_ls = function() + local lua_opts = lsp_zero.nvim_lua_ls() + require('lspconfig').lua_ls.setup(lua_opts) + end + } + }) + + local cmp = require('cmp') + local cmp_select = { + behavior = cmp.SelectBehavior.Select + } + + -- this is the function that loads the extra snippets to luasnip + -- from rafamadriz/friendly-snippets + require('luasnip.loaders.from_vscode').lazy_load() + + cmp.setup({ + sources = { { + name = 'path' + }, { + name = 'nvim_lsp' + }, { + name = 'nvim_lua' + }, { + name = 'luasnip', + keyword_length = 2 + }, { + name = 'buffer', + keyword_length = 3 + } }, + formatting = lsp_zero.cmp_format(), + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.select_prev_item(cmp_select), + [''] = cmp.mapping.select_next_item(cmp_select), + [''] = cmp.mapping.confirm({ + select = true + }) + -- [''] = cmp.mapping.complete(), + }) + }) + end + }, { + 'williamboman/mason.nvim', + config = function() + require('mason').setup() + end +}, { + 'williamboman/mason-lspconfig.nvim', + config = function() + require('mason-lspconfig').setup() + end +}, + -- + -- END OF LSP Zero conf + -- + { + "ray-x/lsp_signature.nvim", + config = function() + require 'lsp_signature'.setup({ + on_attach = function(client, bufnr) + require "lsp_signature".on_attach({ + bind = true, -- This is mandatory, otherwise border config won't get registered. + handler_opts = { + border = "rounded" + } + }, bufnr) + end + }) + end + }, { + 'nvim-lualine/lualine.nvim', + dependencies = { + 'nvim-tree/nvim-web-devicons', + opt = true, + config = function() + local git_blame = require('gitblame') + + require('lualine').setup { + options = { + icons_enabled = true, + theme = 'auto', + component_separators = { + left = '', + right = '' + }, + section_separators = { + left = '', + right = '' + }, + disabled_filetypes = { + statusline = {}, + winbar = {} + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000 + } + }, + sections = { + lualine_a = { 'mode' }, + lualine_b = { 'branch', 'diff', 'diagnostics' }, + lualine_c = {}, + lualine_x = { { + git_blame.get_current_blame_text, + cond = git_blame.is_blame_text_available, + draw_empty = false, + separator = { + right = '', + left = '' + }, + color = { + fg = '#282A36', + bg = '#8BE9FD' + } + } }, + lualine_y = { 'progress' }, + lualine_z = { 'location' } + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { 'filename' }, + lualine_x = { 'location' }, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {} + } + end + } +}, { + 'akinsho/bufferline.nvim', + dependencies = 'nvim-tree/nvim-web-devicons', + config = function() + vim.opt.termguicolors = true + require("bufferline").setup {} + end +}, { + 'lukas-reineke/indent-blankline.nvim', + config = function() + require("ibl").setup({ + indent = { + char = '▏' + }, + exclude = { filetypes = { "dashboard" } } + }) + end +}, { + 'norcalli/nvim-colorizer.lua', + config = function() + require 'colorizer'.setup() + end +}, { + 'f-person/git-blame.nvim', + config = function() + require('gitblame').setup { + -- Note how the `gitblame_` prefix is omitted in `setup` + enabled = true + } + vim.g.gitblame_display_virtual_text = 0 + vim.g.gitblame_message_template = '' + vim.g.gitblame_date_format = '%b %d, %Y at %I:%M %p' + vim.g.gitblame_delay = 100 + end +}, { + "akinsho/toggleterm.nvim", + config = function() + -- Calculate center window position + local function center_win(width, height) + -- Get the dimensions of the Neovim window + local vim_width = vim.api.nvim_get_option("columns") + local vim_height = vim.api.nvim_get_option("lines") + + -- Calculate the position to center the floating window + local row = math.ceil((vim_height - height) / 2) + local col = math.ceil((vim_width - width) / 2) + + return { + relative = "editor", + row = row, + col = col, + width = width, + height = height + } + end + + require("toggleterm").setup { + shade_terminals = false, + open_mapping = '', + shell = vim.o.shell, + direction = 'float', + float_opts = { + border = 'single', + width = math.floor(vim.o.columns * 0.8), -- 80% width + height = math.floor(vim.o.lines * 0.6), -- 60% height + winblend = 0, -- Transparency level + highlights = { + border = "Normal" + } + }, + size = function(term) + return center_win(term.float_opts.width, term.float_opts.height) + end + } + end +}, { + 'numToStr/Comment.nvim', + config = function() + require('Comment').setup {} + end +}, { + "windwp/nvim-autopairs", + event = "InsertEnter", + config = function() + require("nvim-autopairs").setup {} + end +}, { + "folke/todo-comments.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("todo-comments").setup({ + keywords = { + FIX = { + icon = " ", -- icon used for the sign, and in search results + color = "error", -- can be a hex color, or a named color (see below) + alt = { "FIXME", "BUG", "FIXIT", "ISSUE" } -- a set of other keywords that all map to this FIX keywords + -- signs = false, -- configure signs for some keywords individually + }, + TODO = { + icon = " ", + color = "info" + }, + HACK = { + icon = " ", + color = "warning" + }, + WARN = { + icon = " ", + color = "warning", + alt = { "WARNING", "XXX" } + }, + PERF = { + icon = " ", + alt = { "" } + }, + NOTE = { + icon = " ", + color = "#50fa7b", + alt = { "" } + }, + TEST = { + icon = "⏲ ", + color = "#FF79c6", + alt = { "" } + } + }, + colors = { + error = { "DiagnosticError", "ErrorMsg", "#FF5555" }, + warning = { "DiagnosticWarn", "WarningMsg", "#FFB86C" }, + info = { "DiagnosticInfo", "#8BE9FD" }, + hint = { "DiagnosticHint", "#50FA7B" }, + default = { "Identifier", "#BD93F9" }, + test = { "Identifier", "#FF79C6" } + } + }) + end +}, { + 'kevinhwang91/nvim-ufo', + dependencies = { { + 'kevinhwang91/promise-async' + }, + { + "luukvbaal/statuscol.nvim", + config = function() + local builtin = require("statuscol.builtin") + require("statuscol").setup( + { + relculright = true, + segments = { + { text = { builtin.foldfunc }, click = "v:lua.ScFa" }, + { text = { "%s" }, click = "v:lua.ScSa" }, + { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" } + } + } + ) + end + + } }, + config = function() + vim.o.foldcolumn = '1' -- '0' is not bad + vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value + vim.o.foldlevelstart = 99 + vim.o.foldenable = true + vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]] + + -- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself + vim.keymap.set('n', 'zR', require('ufo').openAllFolds) + vim.keymap.set('n', 'zM', require('ufo').closeAllFolds) + + require('ufo').setup({ + provider_selector = function(bufnr, filetype, buftype) + return { 'lsp', 'indent' } + end + }) + end +}, { + 'anuvyklack/pretty-fold.nvim', + config = function() + require('pretty-fold').setup { + keep_indentation = false, + fill_char = '•', + sections = { + left = { '+', function() + return string.rep('-', vim.v.foldlevel) + end, ' ', 'number_of_folded_lines', ':', 'content' } + } + } + end +}, { + "kdheepak/lazygit.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + -- config here + end +}, { + 'nvimdev/dashboard-nvim', + event = 'VimEnter', + config = function() + require('dashboard').setup { + -- config + } + end, + dependencies = { 'nvim-tree/nvim-web-devicons' } +}, { + 'kawre/leetcode.nvim', + build = ':TSUpdate html', + dependencies = { 'nvim-telescope/telescope.nvim', 'nvim-lua/plenary.nvim', -- required by telescope + 'MunifTanjim/nui.nvim', -- optional + 'nvim-treesitter/nvim-treesitter', 'rcarriga/nvim-notify', + 'nvim-tree/nvim-web-devicons' -- previously nvim-tree/nvim-web-devicons + }, + config = function() + require('leetcode').setup { + lang = 'javascript' + } + end +}, { + 'karb94/neoscroll.nvim', + config = function() + require('neoscroll').setup {} + end +} }) + +function ColorMeUp(color) + color = color or "dracula" + vim.cmd.colorscheme(color) +end + +ColorMeUp() +vim.cmd('highlight FoldColumn guibg=#282A36 guifg=#6272A4 ') + +LS = require('luasnip') +CONFORM = require('conform') + +vim.treesitter.query.set("javascript", "injections", "") +vim.treesitter.query.set("typescript", "injections", "") +vim.treesitter.query.set("lua", "injections", "") diff --git a/nvim/lua/plugins/package-lock.json b/nvim/lua/plugins/package-lock.json new file mode 100644 index 0000000..07be541 --- /dev/null +++ b/nvim/lua/plugins/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "plugins", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/nvim/lua/remap.lua b/nvim/lua/remap.lua new file mode 100644 index 0000000..d68ed16 --- /dev/null +++ b/nvim/lua/remap.lua @@ -0,0 +1,74 @@ +-- Git blame binds +vim.keymap.set('n', 'gbo', ':GitBlameOpenFileURL', { silent = true }) + +vim.keymap.set('n', 'n', ':NvimTreeToggle', { silent = true, noremap = true }) +vim.keymap.set('n', '', 'h', { noremap = true }) +vim.keymap.set('n', '', 'j', { noremap = true }) +vim.keymap.set('n', '', 'k', { noremap = true }) +vim.keymap.set('n', '', 'l', { noremap = true }) + +-- Bufferline tab switching +vim.keymap.set('n', 't1', ':lua require"bufferline".go_to_buffer(1)', { noremap = true, silent = true }) +vim.keymap.set('n', 't2', ':lua require"bufferline".go_to_buffer(2)', { noremap = true, silent = true }) +vim.keymap.set('n', 't3', ':lua require"bufferline".go_to_buffer(3)', { noremap = true, silent = true }) +vim.keymap.set('n', 't4', ':lua require"bufferline".go_to_buffer(4)', { noremap = true, silent = true }) +vim.keymap.set('n', 't5', ':lua require"bufferline".go_to_buffer(5)', { noremap = true, silent = true }) +vim.keymap.set('n', 't6', ':lua require"bufferline".go_to_buffer(6)', { noremap = true, silent = true }) + +-- Delete current buffer +vim.keymap.set('n', 'td', ':bd', { silent = true }) + +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") + +--vim.keymap.set("n", "J", "mzJ`z") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") + +-- greatest remap ever +vim.keymap.set("x", "p", [["_dP]]) + +-- next greatest remap ever : asbjornHaland +vim.keymap.set({ "n", "v" }, "y", [["+y]]) +vim.keymap.set("n", "Y", [["+Y]]) + +vim.keymap.set({ "n", "v" }, "d", [["_d]]) + +-- remap normal mode to Alt + Space +vim.keymap.set("i", "", "") + +vim.keymap.set("n", "Q", "") +vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") +vim.keymap.set("n", "f", function() + CONFORM.format({async=true,lsp_fallback=true}) +end) + +vim.keymap.set("n", "", "cnextzz") +vim.keymap.set("n", "", "cprevzz") +vim.keymap.set("n", "k", "lnextzz") +vim.keymap.set("n", "j", "lprevzz") + +vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) +vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) + +vim.keymap.set("n", "vpp", "e ~/.config/nvim/lua/plugin_loader.lua"); +vim.keymap.set("n", "mr", "CellularAutomaton make_it_rain"); + +vim.keymap.set("n", "", function() + vim.cmd("so") +end) + +vim.keymap.set({ "n", "i" }, "", '"+p') + +-- LuaSnip snippet keybinds +vim.keymap.set({ "i" }, "", function() LS.expand() end, { silent = true }) +vim.keymap.set({ "i", "s" }, "", function() LS.jump(1) end, { silent = true }) +vim.keymap.set({ "i", "s" }, "", function() LS.jump(-1) end, { silent = true }) + +vim.keymap.set({ "i", "s" }, "", function() + if LS.choice_active() then + LS.change_choice(1) + end +end, { silent = true }) diff --git a/nvim/lua/set.lua b/nvim/lua/set.lua new file mode 100644 index 0000000..3289094 --- /dev/null +++ b/nvim/lua/set.lua @@ -0,0 +1,30 @@ +vim.opt.nu = true +vim.opt.relativenumber = true + +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true + +vim.opt.smartindent = true + +vim.opt.wrap = false + +vim.opt.swapfile = false +vim.opt.backup = false +--vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +--vim.opt.undofile = true + +vim.opt.hlsearch = false +vim.opt.incsearch = true + +vim.opt.termguicolors = true + +vim.opt.scrolloff = 4 +vim.opt.signcolumn = "yes" +vim.opt.isfname:append("@-@") + +vim.opt.updatetime = 100 + +--vim.opt.colorcolumn = "80" + diff --git a/nvim/package-lock.json b/nvim/package-lock.json new file mode 100644 index 0000000..b7ea3d5 --- /dev/null +++ b/nvim/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "nvim", + "lockfileVersion": 3, + "requires": true, + "packages": {} +}