Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- === init.lua ===
- -- PACKAGE MANAGER
- 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)
- require("lazy").setup("plugins")
- require("custom")
- require("config")
- === lua/plugins/gh-co.lua ===
- -- Github codeowners
- return {
- "comatory/gh-co.nvim",
- config = function()
- vim.keymap.set("n", "<leader>gg", ":GhCoWho<CR>", {})
- end
- }
- === lua/plugins/swapfile.lua ===
- -- Manage swap files automatically
- return {
- "gioele/vim-autoswap",
- config = function()
- vim.g.autoswap_detect_tmux = 1
- end,
- }
- === lua/plugins/autoclose.lua ===
- -- Autocloses brackets and pairs
- return {
- 'windwp/nvim-autopairs',
- event = "InsertEnter",
- config = true
- }
- === lua/plugins/git.lua ===
- -- Git related plugins
- return {
- {
- "tpope/vim-fugitive",
- config = function()
- vim.keymap.set("n", "<leader>gs", ":Gdiffsplit HEAD<CR>", {})
- vim.keymap.set("n", "<leader>gl", " :Gllog<CR>", {})
- end,
- },
- {
- "lewis6991/gitsigns.nvim",
- config = function()
- require("gitsigns").setup()
- end,
- }
- }
- === lua/plugins/telescope.lua ===
- -- fuzzy file search / content search with UI
- return {
- {
- "nvim-telescope/telescope.nvim",
- dependencies = {
- "nvim-lua/plenary.nvim",
- "nvim-telescope/telescope-live-grep-args.nvim",
- },
- config = function()
- local builtin = require("telescope.builtin")
- local layout = require("telescope.actions.layout")
- local actions = require("telescope.actions")
- local findIgnored = function()
- return builtin.find_files({
- no_ignore = false,
- hidden = true,
- })
- end
- local sortedBuffers = function()
- return builtin.buffers({
- sort_mru = true,
- })
- end
- vim.keymap.set("n", "<C-p>", builtin.find_files, {})
- vim.keymap.set("n", "<C-[>", findIgnored, {})
- vim.keymap.set("n", "<C-l>", builtin.live_grep, {})
- vim.keymap.set("n", "<C-x>", sortedBuffers, {})
- local telescope = require("telescope")
- local opts = {
- defaults = {
- mappings = {
- i = {
- ["<C-e>"] = layout.toggle_preview,
- ["<C-j>"] = actions.move_selection_next,
- ["<C-k>"] = actions.move_selection_previous,
- ["<C-h>"] = actions.results_scrolling_left,
- ["<C-l>"] = actions.results_scrolling_right,
- },
- },
- },
- }
- -- replace ripgrep with ag
- -- https://github.com/nvim-telescope/telescope.nvim/issues/2083
- local ag = os.execute("command -v " .. "ag")
- if ag == 0 then
- opts.defaults.vimgrep_arguments = {
- "ag",
- "--nocolor",
- "--noheading",
- "--numbers",
- "--column",
- "--smart-case",
- "--silent",
- "--vimgrep",
- }
- end
- -- extension for grepping with arguments
- vim.keymap.set("n", "<C-k>", ":lua require('telescope').extensions.live_grep_args.live_grep_args()<CR>", {})
- telescope.setup(opts)
- telescope.load_extension("live_grep_args")
- telescope.load_extension("ui-select")
- end,
- },
- {
- "nvim-telescope/telescope-ui-select.nvim",
- config = function()
- require("telescope").setup({
- extensions = {
- ["ui-select"] = {
- require("telescope.themes").get_dropdown({}),
- },
- },
- })
- require("telescope").load_extension("ui-select")
- end,
- },
- }
- === lua/plugins/searchindex.lua ===
- -- adds match counter when searching a file
- return {
- "google/vim-searchindex"
- }
- === lua/plugins/copilot.lua ===
- -- AI assistant
- return {
- "github/copilot.vim",
- config = function()
- -- vim.keymap.set("n", "<C-j>", "<Plug>(copilot-next)", {})
- -- vim.keymap.set("n", "<C-k>", "<Plug>(copilot-previous)", {})
- end
- }
- === lua/plugins/trouble.lua ===
- -- Diagnostics UI
- return {
- "folke/trouble.nvim",
- opts = {},
- dependencies = { "nvim-tree/nvim-web-devicons" },
- }
- === lua/plugins/lualine.lua ===
- -- status line
- return {
- "nvim-lualine/lualine.nvim",
- dependencies = { 'nvim-tree/nvim-web-devicons' },
- config = function()
- require("lualine").setup({
- theme = "newpaper-light",
- })
- end
- }
- === lua/plugins/newpaper.lua ===
- -- color scheme
- return {
- "yorik1984/newpaper.nvim",
- config = function()
- require("newpaper").setup({
- style = "light",
- })
- end,
- }
- === lua/plugins/lsp.lua ===
- -- autocomplete / LSP configurations
- return {
- {
- "williamboman/mason.nvim",
- config = function()
- require("mason").setup()
- end,
- },
- {
- "williamboman/mason-lspconfig.nvim",
- config = function()
- require("mason-lspconfig").setup({
- ensure_installed = {
- "cssls",
- "dockerls",
- "gopls",
- "graphql",
- "jsonls",
- "ts_ls",
- "eslint",
- "biome",
- "lua_ls",
- "marksman",
- "hydra_lsp",
- },
- })
- end,
- },
- {
- "neovim/nvim-lspconfig",
- config = function()
- -- local lspconfig = require("lspconfig")
- -- local capabilities = require("cmp_nvim_lsp").default_capabilities()
- -- lspconfig.cssls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.dockerls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.gopls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.graphql.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.jsonls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.ts_ls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.eslint.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.biome.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.lua_ls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.marksman.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.hydra_lsp.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.pico8_ls.setup({
- -- capabilities = capabilities,
- -- })
- vim.api.nvim_create_autocmd("LspAttach", {
- group = vim.api.nvim_create_augroup("UserLspConfig", {}),
- callback = function(ev)
- local opts = { buffer = ev.buf }
- vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
- vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
- vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
- vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
- end,
- })
- end,
- },
- }
- === lua/plugins/octo.lua ===
- -- Manage Github reviews
- return {
- 'pwntester/octo.nvim',
- dependencies = {
- 'nvim-lua/plenary.nvim',
- 'nvim-telescope/telescope.nvim',
- 'nvim-tree/nvim-web-devicons',
- },
- config = function ()
- require("octo").setup()
- end
- }
- === lua/plugins/rhubarb.lua ===
- -- Enables browsing Github with `fugitive`
- return {
- "tpope/vim-rhubarb"
- }
- === lua/plugins/none-ls.lua ===
- -- Linting & formatting
- return {
- "nvimtools/none-ls.nvim",
- dependencies = { "nvimtools/none-ls-extras.nvim" },
- config = function()
- local null_ls = require("null-ls")
- null_ls.setup({
- sources = {
- null_ls.builtins.formatting.stylua,
- null_ls.builtins.formatting.biome,
- null_ls.builtins.formatting.prettier,
- -- using instead of built-in: https://github.com/nvimtools/none-ls.nvim/discussions/81
- -- null_ls.builtins.diagnostics.eslint_d,
- require("none-ls.diagnostics.eslint_d"),
- null_ls.builtins.diagnostics.golangci_lint,
- null_ls.builtins.formatting.goimports,
- },
- })
- vim.diagnostic.config({
- virtual_text = true
- })
- vim.api.nvim_create_user_command("Format", ':lua vim.lsp.buf.format()' ,{})
- end
- }
- === lua/plugins/treesitter.lua ===
- -- syntax highlighting
- return {
- "nvim-treesitter/nvim-treesitter",
- build = ":TSUpdate",
- config = function()
- local configs = require("nvim-treesitter.configs")
- configs.setup {
- ensure_installed = { "go", "javascript", "typescript", "json", "yaml", "html", "css", "lua", "bash"
- },
- highlight = {
- enable = true,
- },
- indent = {
- enable = true,
- },
- }
- end
- }
- === lua/plugins/autocomplete.lua ===
- -- Autocomplete & snippets
- return {
- -- adds source from opened buffers & LSP to be provided to autocompletion
- {
- "hrsh7th/cmp-nvim-lsp",
- },
- -- adds nice snippets for autocompletion
- {
- "L3MON4D3/LuaSnip",
- dependencies = {
- "saadparwaiz1/cmp_luasnip",
- "rafamadriz/friendly-snippets",
- },
- },
- {
- "hrsh7th/nvim-cmp",
- config = function()
- local cmp = require("cmp")
- cmp.setup({
- snippet = {
- expand = function(args)
- require("luasnip").lsp_expand(args.body)
- end,
- },
- window = {
- completion = cmp.config.window.bordered(),
- documentation = cmp.config.window.bordered(),
- },
- mapping = cmp.mapping.preset.insert({
- ["<C-j>"] = cmp.mapping.scroll_docs(-4),
- ["<C-k>"] = cmp.mapping.scroll_docs(4),
- ["<C-Space>"] = cmp.mapping.complete(),
- ["<C-c>"] = cmp.mapping.abort(),
- ["<Enter>"] = cmp.mapping.confirm({ select = true }),
- }),
- sources = cmp.config.sources({
- { name = "nvim_lsp" },
- { name = "luasnip" }, -- For luasnip users.
- }, {
- { name = "buffer" },
- }),
- })
- require("luasnip.loaders.from_vscode").lazy_load()
- end,
- },
- }
- === lua/plugins/surround.lua ===
- -- transform surrounds (brackets, parentheses, quotes, etc)
- return {
- "tpope/vim-surround"
- }
- === lua/plugins/neotree.lua ===
- -- file browser
- return {
- "nvim-neo-tree/neo-tree.nvim",
- dependencies = {
- "nvim-lua/plenary.nvim",
- "nvim-tree/nvim-web-devicons",
- "MunifTanjim/nui.nvim",
- },
- config = function()
- vim.keymap.set('n', '<C-n>', ':Neotree reveal toggle left<CR>', {})
- local neotree = require('neo-tree')
- neotree.setup({
- use_popups_for_input = false,
- })
- end
- }
- === lua/config.lua ===
- -- MAIN CONFIG
- -- general
- vim.cmd("set clipboard=unnamed")
- vim.cmd("set mouse=a")
- -- line numbers
- vim.cmd("set number")
- vim.cmd("set title")
- vim.cmd("set cursorline")
- vim.cmd("set expandtab")
- -- indentation
- vim.cmd("set shiftwidth=2")
- vim.cmd("set softtabstop=2")
- vim.cmd("set tabstop=2")
- -- whitespace
- -- indicate whitespace
- vim.cmd("set listchars+=space:·")
- vim.cmd("set list")
- -- git
- -- open diff's in vertical split
- vim.cmd("set diffopt=vertical")
- -- search
- -- ignore case during file search
- vim.cmd("set ignorecase")
- -- style
- vim.cmd("set t_Co=256")
- -- highlights column at 80 and 120
- vim.cmd("set colorcolumn=80,120")
- === lua/custom/init.lua ===
- require("custom.filepath")
- require("custom.terminal")
- require("custom.windows")
- require("custom.quickfix")
- === lua/custom/terminal.lua ===
- -- switch to normal mode when active in terminal session
- vim.keymap.set('t', '<Esc>', [[<C-\><C-n>]], { silent=true })
- === lua/custom/quickfix.lua ===
- -- quickfix
- -- next term
- vim.keymap.set("n", "<leader>]]", ":cn<CR>", { silent = true })
- -- prev term
- vim.keymap.set("n", "<leader>[[", ":cp<CR>", { silent = true })
- -- next file
- vim.keymap.set("n", "<leader>]]n", ":cnfile<CR>", { silent = true })
- -- prev file
- vim.keymap.set("n", "<leader>[[p", ":cNfile<CR>", { silent = true })
- === lua/custom/filepath.lua ===
- -- show full path of current buffer
- vim.keymap.set('n', 'F', ':echo @%<CR>', {})
- -- copy relative path to clipboard
- vim.keymap.set('n', '<leader>cF', ':let @*=expand("%")<CR>', {})
- -- copy absolute path to clipboard
- vim.keymap.set('n', '<leader>cf', ':let @*=expand("%:p")<CR>', {})
- -- copy filename
- vim.keymap.set('n', '<leader>ct', ':let @*=expand("%:t")<CR>', {})
- -- copy directory name
- vim.keymap.set('n', '<leader>ch', ':let @*=expand("%:p:h")<CR>', {})
- === lua/custom/windows.lua ===
- -- open new tab with current buffer
- vim.keymap.set('n', '<leader>N', ':tabe %<CR>', {})
- -- open new empty tab
- vim.keymap.set('n', '<leader>n', ':tabe<CR>', {})
- -- close current tab
- vim.keymap.set('n', '<leader><Esc>', ':tabclose<CR>', {})
- === lua/config.lua ===
- -- MAIN CONFIG
- -- general
- vim.cmd("set clipboard=unnamed")
- vim.cmd("set mouse=a")
- -- line numbers
- vim.cmd("set number")
- vim.cmd("set title")
- vim.cmd("set cursorline")
- vim.cmd("set expandtab")
- -- indentation
- vim.cmd("set shiftwidth=2")
- vim.cmd("set softtabstop=2")
- vim.cmd("set tabstop=2")
- -- whitespace
- -- indicate whitespace
- vim.cmd("set listchars+=space:·")
- vim.cmd("set list")
- -- git
- -- open diff's in vertical split
- vim.cmd("set diffopt=vertical")
- -- search
- -- ignore case during file search
- vim.cmd("set ignorecase")
- -- style
- vim.cmd("set t_Co=256")
- -- highlights column at 80 and 120
- vim.cmd("set colorcolumn=80,120")
- === lua/custom/init.lua ===
- require("custom.filepath")
- require("custom.terminal")
- require("custom.windows")
- require("custom.quickfix")
- === lua/custom/terminal.lua ===
- -- switch to normal mode when active in terminal session
- vim.keymap.set('t', '<Esc>', [[<C-\><C-n>]], { silent=true })
- === lua/custom/quickfix.lua ===
- -- quickfix
- -- next term
- vim.keymap.set("n", "<leader>]]", ":cn<CR>", { silent = true })
- -- prev term
- vim.keymap.set("n", "<leader>[[", ":cp<CR>", { silent = true })
- -- next file
- vim.keymap.set("n", "<leader>]]n", ":cnfile<CR>", { silent = true })
- -- prev file
- vim.keymap.set("n", "<leader>[[p", ":cNfile<CR>", { silent = true })
- === lua/custom/filepath.lua ===
- -- show full path of current buffer
- vim.keymap.set('n', 'F', ':echo @%<CR>', {})
- -- copy relative path to clipboard
- vim.keymap.set('n', '<leader>cF', ':let @*=expand("%")<CR>', {})
- -- copy absolute path to clipboard
- vim.keymap.set('n', '<leader>cf', ':let @*=expand("%:p")<CR>', {})
- -- copy filename
- vim.keymap.set('n', '<leader>ct', ':let @*=expand("%:t")<CR>', {})
- -- copy directory name
- vim.keymap.set('n', '<leader>ch', ':let @*=expand("%:p:h")<CR>', {})
- === lua/custom/windows.lua ===
- -- open new tab with current buffer
- vim.keymap.set('n', '<leader>N', ':tabe %<CR>', {})
- -- open new empty tab
- vim.keymap.set('n', '<leader>n', ':tabe<CR>', {})
- -- close current tab
- vim.keymap.set('n', '<leader><Esc>', ':tabclose<CR>', {})
- === lua/custom/filepath.lua ===
- -- show full path of current buffer
- vim.keymap.set('n', 'F', ':echo @%<CR>', {})
- -- copy relative path to clipboard
- vim.keymap.set('n', '<leader>cF', ':let @*=expand("%")<CR>', {})
- -- copy absolute path to clipboard
- vim.keymap.set('n', '<leader>cf', ':let @*=expand("%:p")<CR>', {})
- -- copy filename
- vim.keymap.set('n', '<leader>ct', ':let @*=expand("%:t")<CR>', {})
- -- copy directory name
- vim.keymap.set('n', '<leader>ch', ':let @*=expand("%:p:h")<CR>', {})
- === lua/custom/init.lua ===
- require("custom.filepath")
- require("custom.terminal")
- require("custom.windows")
- require("custom.quickfix")
- === lua/custom/quickfix.lua ===
- -- quickfix
- -- next term
- vim.keymap.set("n", "<leader>]]", ":cn<CR>", { silent = true })
- -- prev term
- vim.keymap.set("n", "<leader>[[", ":cp<CR>", { silent = true })
- -- next file
- vim.keymap.set("n", "<leader>]]n", ":cnfile<CR>", { silent = true })
- -- prev file
- vim.keymap.set("n", "<leader>[[p", ":cNfile<CR>", { silent = true })
- === lua/custom/terminal.lua ===
- -- switch to normal mode when active in terminal session
- vim.keymap.set('t', '<Esc>', [[<C-\><C-n>]], { silent=true })
- === lua/custom/windows.lua ===
- -- open new tab with current buffer
- vim.keymap.set('n', '<leader>N', ':tabe %<CR>', {})
- -- open new empty tab
- vim.keymap.set('n', '<leader>n', ':tabe<CR>', {})
- -- close current tab
- vim.keymap.set('n', '<leader><Esc>', ':tabclose<CR>', {})
- === lua/plugins/gh-co.lua ===
- -- Github codeowners
- return {
- "comatory/gh-co.nvim",
- config = function()
- vim.keymap.set("n", "<leader>gg", ":GhCoWho<CR>", {})
- end
- }
- === lua/plugins/swapfile.lua ===
- -- Manage swap files automatically
- return {
- "gioele/vim-autoswap",
- config = function()
- vim.g.autoswap_detect_tmux = 1
- end,
- }
- === lua/plugins/autoclose.lua ===
- -- Autocloses brackets and pairs
- return {
- 'windwp/nvim-autopairs',
- event = "InsertEnter",
- config = true
- }
- === lua/plugins/git.lua ===
- -- Git related plugins
- return {
- {
- "tpope/vim-fugitive",
- config = function()
- vim.keymap.set("n", "<leader>gs", ":Gdiffsplit HEAD<CR>", {})
- vim.keymap.set("n", "<leader>gl", " :Gllog<CR>", {})
- end,
- },
- {
- "lewis6991/gitsigns.nvim",
- config = function()
- require("gitsigns").setup()
- end,
- }
- }
- === lua/plugins/telescope.lua ===
- -- fuzzy file search / content search with UI
- return {
- {
- "nvim-telescope/telescope.nvim",
- dependencies = {
- "nvim-lua/plenary.nvim",
- "nvim-telescope/telescope-live-grep-args.nvim",
- },
- config = function()
- local builtin = require("telescope.builtin")
- local layout = require("telescope.actions.layout")
- local actions = require("telescope.actions")
- local findIgnored = function()
- return builtin.find_files({
- no_ignore = false,
- hidden = true,
- })
- end
- local sortedBuffers = function()
- return builtin.buffers({
- sort_mru = true,
- })
- end
- vim.keymap.set("n", "<C-p>", builtin.find_files, {})
- vim.keymap.set("n", "<C-[>", findIgnored, {})
- vim.keymap.set("n", "<C-l>", builtin.live_grep, {})
- vim.keymap.set("n", "<C-x>", sortedBuffers, {})
- local telescope = require("telescope")
- local opts = {
- defaults = {
- mappings = {
- i = {
- ["<C-e>"] = layout.toggle_preview,
- ["<C-j>"] = actions.move_selection_next,
- ["<C-k>"] = actions.move_selection_previous,
- ["<C-h>"] = actions.results_scrolling_left,
- ["<C-l>"] = actions.results_scrolling_right,
- },
- },
- },
- }
- -- replace ripgrep with ag
- -- https://github.com/nvim-telescope/telescope.nvim/issues/2083
- local ag = os.execute("command -v " .. "ag")
- if ag == 0 then
- opts.defaults.vimgrep_arguments = {
- "ag",
- "--nocolor",
- "--noheading",
- "--numbers",
- "--column",
- "--smart-case",
- "--silent",
- "--vimgrep",
- }
- end
- -- extension for grepping with arguments
- vim.keymap.set("n", "<C-k>", ":lua require('telescope').extensions.live_grep_args.live_grep_args()<CR>", {})
- telescope.setup(opts)
- telescope.load_extension("live_grep_args")
- telescope.load_extension("ui-select")
- end,
- },
- {
- "nvim-telescope/telescope-ui-select.nvim",
- config = function()
- require("telescope").setup({
- extensions = {
- ["ui-select"] = {
- require("telescope.themes").get_dropdown({}),
- },
- },
- })
- require("telescope").load_extension("ui-select")
- end,
- },
- }
- === lua/plugins/searchindex.lua ===
- -- adds match counter when searching a file
- return {
- "google/vim-searchindex"
- }
- === lua/plugins/copilot.lua ===
- -- AI assistant
- return {
- "github/copilot.vim",
- config = function()
- -- vim.keymap.set("n", "<C-j>", "<Plug>(copilot-next)", {})
- -- vim.keymap.set("n", "<C-k>", "<Plug>(copilot-previous)", {})
- end
- }
- === lua/plugins/trouble.lua ===
- -- Diagnostics UI
- return {
- "folke/trouble.nvim",
- opts = {},
- dependencies = { "nvim-tree/nvim-web-devicons" },
- }
- === lua/plugins/lualine.lua ===
- -- status line
- return {
- "nvim-lualine/lualine.nvim",
- dependencies = { 'nvim-tree/nvim-web-devicons' },
- config = function()
- require("lualine").setup({
- theme = "newpaper-light",
- })
- end
- }
- === lua/plugins/newpaper.lua ===
- -- color scheme
- return {
- "yorik1984/newpaper.nvim",
- config = function()
- require("newpaper").setup({
- style = "light",
- })
- end,
- }
- === lua/plugins/lsp.lua ===
- -- autocomplete / LSP configurations
- return {
- {
- "williamboman/mason.nvim",
- config = function()
- require("mason").setup()
- end,
- },
- {
- "williamboman/mason-lspconfig.nvim",
- config = function()
- require("mason-lspconfig").setup({
- ensure_installed = {
- "cssls",
- "dockerls",
- "gopls",
- "graphql",
- "jsonls",
- "ts_ls",
- "eslint",
- "biome",
- "lua_ls",
- "marksman",
- "hydra_lsp",
- },
- })
- end,
- },
- {
- "neovim/nvim-lspconfig",
- config = function()
- -- local lspconfig = require("lspconfig")
- -- local capabilities = require("cmp_nvim_lsp").default_capabilities()
- -- lspconfig.cssls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.dockerls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.gopls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.graphql.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.jsonls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.ts_ls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.eslint.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.biome.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.lua_ls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.marksman.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.hydra_lsp.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.pico8_ls.setup({
- -- capabilities = capabilities,
- -- })
- vim.api.nvim_create_autocmd("LspAttach", {
- group = vim.api.nvim_create_augroup("UserLspConfig", {}),
- callback = function(ev)
- local opts = { buffer = ev.buf }
- vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
- vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
- vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
- vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
- end,
- })
- end,
- },
- }
- === lua/plugins/octo.lua ===
- -- Manage Github reviews
- return {
- 'pwntester/octo.nvim',
- dependencies = {
- 'nvim-lua/plenary.nvim',
- 'nvim-telescope/telescope.nvim',
- 'nvim-tree/nvim-web-devicons',
- },
- config = function ()
- require("octo").setup()
- end
- }
- === lua/plugins/rhubarb.lua ===
- -- Enables browsing Github with `fugitive`
- return {
- "tpope/vim-rhubarb"
- }
- === lua/plugins/none-ls.lua ===
- -- Linting & formatting
- return {
- "nvimtools/none-ls.nvim",
- dependencies = { "nvimtools/none-ls-extras.nvim" },
- config = function()
- local null_ls = require("null-ls")
- null_ls.setup({
- sources = {
- null_ls.builtins.formatting.stylua,
- null_ls.builtins.formatting.biome,
- null_ls.builtins.formatting.prettier,
- -- using instead of built-in: https://github.com/nvimtools/none-ls.nvim/discussions/81
- -- null_ls.builtins.diagnostics.eslint_d,
- require("none-ls.diagnostics.eslint_d"),
- null_ls.builtins.diagnostics.golangci_lint,
- null_ls.builtins.formatting.goimports,
- },
- })
- vim.diagnostic.config({
- virtual_text = true
- })
- vim.api.nvim_create_user_command("Format", ':lua vim.lsp.buf.format()' ,{})
- end
- }
- === lua/plugins/treesitter.lua ===
- -- syntax highlighting
- return {
- "nvim-treesitter/nvim-treesitter",
- build = ":TSUpdate",
- config = function()
- local configs = require("nvim-treesitter.configs")
- configs.setup {
- ensure_installed = { "go", "javascript", "typescript", "json", "yaml", "html", "css", "lua", "bash"
- },
- highlight = {
- enable = true,
- },
- indent = {
- enable = true,
- },
- }
- end
- }
- === lua/plugins/autocomplete.lua ===
- -- Autocomplete & snippets
- return {
- -- adds source from opened buffers & LSP to be provided to autocompletion
- {
- "hrsh7th/cmp-nvim-lsp",
- },
- -- adds nice snippets for autocompletion
- {
- "L3MON4D3/LuaSnip",
- dependencies = {
- "saadparwaiz1/cmp_luasnip",
- "rafamadriz/friendly-snippets",
- },
- },
- {
- "hrsh7th/nvim-cmp",
- config = function()
- local cmp = require("cmp")
- cmp.setup({
- snippet = {
- expand = function(args)
- require("luasnip").lsp_expand(args.body)
- end,
- },
- window = {
- completion = cmp.config.window.bordered(),
- documentation = cmp.config.window.bordered(),
- },
- mapping = cmp.mapping.preset.insert({
- ["<C-j>"] = cmp.mapping.scroll_docs(-4),
- ["<C-k>"] = cmp.mapping.scroll_docs(4),
- ["<C-Space>"] = cmp.mapping.complete(),
- ["<C-c>"] = cmp.mapping.abort(),
- ["<Enter>"] = cmp.mapping.confirm({ select = true }),
- }),
- sources = cmp.config.sources({
- { name = "nvim_lsp" },
- { name = "luasnip" }, -- For luasnip users.
- }, {
- { name = "buffer" },
- }),
- })
- require("luasnip.loaders.from_vscode").lazy_load()
- end,
- },
- }
- === lua/plugins/surround.lua ===
- -- transform surrounds (brackets, parentheses, quotes, etc)
- return {
- "tpope/vim-surround"
- }
- === lua/plugins/neotree.lua ===
- -- file browser
- return {
- "nvim-neo-tree/neo-tree.nvim",
- dependencies = {
- "nvim-lua/plenary.nvim",
- "nvim-tree/nvim-web-devicons",
- "MunifTanjim/nui.nvim",
- },
- config = function()
- vim.keymap.set('n', '<C-n>', ':Neotree reveal toggle left<CR>', {})
- local neotree = require('neo-tree')
- neotree.setup({
- use_popups_for_input = false,
- })
- end
- }
- === lua/plugins/autoclose.lua ===
- -- Autocloses brackets and pairs
- return {
- 'windwp/nvim-autopairs',
- event = "InsertEnter",
- config = true
- }
- === lua/plugins/autocomplete.lua ===
- -- Autocomplete & snippets
- return {
- -- adds source from opened buffers & LSP to be provided to autocompletion
- {
- "hrsh7th/cmp-nvim-lsp",
- },
- -- adds nice snippets for autocompletion
- {
- "L3MON4D3/LuaSnip",
- dependencies = {
- "saadparwaiz1/cmp_luasnip",
- "rafamadriz/friendly-snippets",
- },
- },
- {
- "hrsh7th/nvim-cmp",
- config = function()
- local cmp = require("cmp")
- cmp.setup({
- snippet = {
- expand = function(args)
- require("luasnip").lsp_expand(args.body)
- end,
- },
- window = {
- completion = cmp.config.window.bordered(),
- documentation = cmp.config.window.bordered(),
- },
- mapping = cmp.mapping.preset.insert({
- ["<C-j>"] = cmp.mapping.scroll_docs(-4),
- ["<C-k>"] = cmp.mapping.scroll_docs(4),
- ["<C-Space>"] = cmp.mapping.complete(),
- ["<C-c>"] = cmp.mapping.abort(),
- ["<Enter>"] = cmp.mapping.confirm({ select = true }),
- }),
- sources = cmp.config.sources({
- { name = "nvim_lsp" },
- { name = "luasnip" }, -- For luasnip users.
- }, {
- { name = "buffer" },
- }),
- })
- require("luasnip.loaders.from_vscode").lazy_load()
- end,
- },
- }
- === lua/plugins/copilot.lua ===
- -- AI assistant
- return {
- "github/copilot.vim",
- config = function()
- -- vim.keymap.set("n", "<C-j>", "<Plug>(copilot-next)", {})
- -- vim.keymap.set("n", "<C-k>", "<Plug>(copilot-previous)", {})
- end
- }
- === lua/plugins/gh-co.lua ===
- -- Github codeowners
- return {
- "comatory/gh-co.nvim",
- config = function()
- vim.keymap.set("n", "<leader>gg", ":GhCoWho<CR>", {})
- end
- }
- === lua/plugins/git.lua ===
- -- Git related plugins
- return {
- {
- "tpope/vim-fugitive",
- config = function()
- vim.keymap.set("n", "<leader>gs", ":Gdiffsplit HEAD<CR>", {})
- vim.keymap.set("n", "<leader>gl", " :Gllog<CR>", {})
- end,
- },
- {
- "lewis6991/gitsigns.nvim",
- config = function()
- require("gitsigns").setup()
- end,
- }
- }
- === lua/plugins/lsp.lua ===
- -- autocomplete / LSP configurations
- return {
- {
- "williamboman/mason.nvim",
- config = function()
- require("mason").setup()
- end,
- },
- {
- "williamboman/mason-lspconfig.nvim",
- config = function()
- require("mason-lspconfig").setup({
- ensure_installed = {
- "cssls",
- "dockerls",
- "gopls",
- "graphql",
- "jsonls",
- "ts_ls",
- "eslint",
- "biome",
- "lua_ls",
- "marksman",
- "hydra_lsp",
- },
- })
- end,
- },
- {
- "neovim/nvim-lspconfig",
- config = function()
- -- local lspconfig = require("lspconfig")
- -- local capabilities = require("cmp_nvim_lsp").default_capabilities()
- -- lspconfig.cssls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.dockerls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.gopls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.graphql.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.jsonls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.ts_ls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.eslint.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.biome.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.lua_ls.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.marksman.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.hydra_lsp.setup({
- -- capabilities = capabilities,
- -- })
- -- lspconfig.pico8_ls.setup({
- -- capabilities = capabilities,
- -- })
- vim.api.nvim_create_autocmd("LspAttach", {
- group = vim.api.nvim_create_augroup("UserLspConfig", {}),
- callback = function(ev)
- local opts = { buffer = ev.buf }
- vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
- vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
- vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
- vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
- end,
- })
- end,
- },
- }
- === lua/plugins/lualine.lua ===
- -- status line
- return {
- "nvim-lualine/lualine.nvim",
- dependencies = { 'nvim-tree/nvim-web-devicons' },
- config = function()
- require("lualine").setup({
- theme = "newpaper-light",
- })
- end
- }
- === lua/plugins/neotree.lua ===
- -- file browser
- return {
- "nvim-neo-tree/neo-tree.nvim",
- dependencies = {
- "nvim-lua/plenary.nvim",
- "nvim-tree/nvim-web-devicons",
- "MunifTanjim/nui.nvim",
- },
- config = function()
- vim.keymap.set('n', '<C-n>', ':Neotree reveal toggle left<CR>', {})
- local neotree = require('neo-tree')
- neotree.setup({
- use_popups_for_input = false,
- })
- end
- }
- === lua/plugins/newpaper.lua ===
- -- color scheme
- return {
- "yorik1984/newpaper.nvim",
- config = function()
- require("newpaper").setup({
- style = "light",
- })
- end,
- }
- === lua/plugins/none-ls.lua ===
- -- Linting & formatting
- return {
- "nvimtools/none-ls.nvim",
- dependencies = { "nvimtools/none-ls-extras.nvim" },
- config = function()
- local null_ls = require("null-ls")
- null_ls.setup({
- sources = {
- null_ls.builtins.formatting.stylua,
- null_ls.builtins.formatting.biome,
- null_ls.builtins.formatting.prettier,
- -- using instead of built-in: https://github.com/nvimtools/none-ls.nvim/discussions/81
- -- null_ls.builtins.diagnostics.eslint_d,
- require("none-ls.diagnostics.eslint_d"),
- null_ls.builtins.diagnostics.golangci_lint,
- null_ls.builtins.formatting.goimports,
- },
- })
- vim.diagnostic.config({
- virtual_text = true
- })
- vim.api.nvim_create_user_command("Format", ':lua vim.lsp.buf.format()' ,{})
- end
- }
- === lua/plugins/octo.lua ===
- -- Manage Github reviews
- return {
- 'pwntester/octo.nvim',
- dependencies = {
- 'nvim-lua/plenary.nvim',
- 'nvim-telescope/telescope.nvim',
- 'nvim-tree/nvim-web-devicons',
- },
- config = function ()
- require("octo").setup()
- end
- }
- === lua/plugins/rhubarb.lua ===
- -- Enables browsing Github with `fugitive`
- return {
- "tpope/vim-rhubarb"
- }
- === lua/plugins/searchindex.lua ===
- -- adds match counter when searching a file
- return {
- "google/vim-searchindex"
- }
- === lua/plugins/surround.lua ===
- -- transform surrounds (brackets, parentheses, quotes, etc)
- return {
- "tpope/vim-surround"
- }
- === lua/plugins/swapfile.lua ===
- -- Manage swap files automatically
- return {
- "gioele/vim-autoswap",
- config = function()
- vim.g.autoswap_detect_tmux = 1
- end,
- }
- === lua/plugins/telescope.lua ===
- -- fuzzy file search / content search with UI
- return {
- {
- "nvim-telescope/telescope.nvim",
- dependencies = {
- "nvim-lua/plenary.nvim",
- "nvim-telescope/telescope-live-grep-args.nvim",
- },
- config = function()
- local builtin = require("telescope.builtin")
- local layout = require("telescope.actions.layout")
- local actions = require("telescope.actions")
- local findIgnored = function()
- return builtin.find_files({
- no_ignore = false,
- hidden = true,
- })
- end
- local sortedBuffers = function()
- return builtin.buffers({
- sort_mru = true,
- })
- end
- vim.keymap.set("n", "<C-p>", builtin.find_files, {})
- vim.keymap.set("n", "<C-[>", findIgnored, {})
- vim.keymap.set("n", "<C-l>", builtin.live_grep, {})
- vim.keymap.set("n", "<C-x>", sortedBuffers, {})
- local telescope = require("telescope")
- local opts = {
- defaults = {
- mappings = {
- i = {
- ["<C-e>"] = layout.toggle_preview,
- ["<C-j>"] = actions.move_selection_next,
- ["<C-k>"] = actions.move_selection_previous,
- ["<C-h>"] = actions.results_scrolling_left,
- ["<C-l>"] = actions.results_scrolling_right,
- },
- },
- },
- }
- -- replace ripgrep with ag
- -- https://github.com/nvim-telescope/telescope.nvim/issues/2083
- local ag = os.execute("command -v " .. "ag")
- if ag == 0 then
- opts.defaults.vimgrep_arguments = {
- "ag",
- "--nocolor",
- "--noheading",
- "--numbers",
- "--column",
- "--smart-case",
- "--silent",
- "--vimgrep",
- }
- end
- -- extension for grepping with arguments
- vim.keymap.set("n", "<C-k>", ":lua require('telescope').extensions.live_grep_args.live_grep_args()<CR>", {})
- telescope.setup(opts)
- telescope.load_extension("live_grep_args")
- telescope.load_extension("ui-select")
- end,
- },
- {
- "nvim-telescope/telescope-ui-select.nvim",
- config = function()
- require("telescope").setup({
- extensions = {
- ["ui-select"] = {
- require("telescope.themes").get_dropdown({}),
- },
- },
- })
- require("telescope").load_extension("ui-select")
- end,
- },
- }
- === lua/plugins/treesitter.lua ===
- -- syntax highlighting
- return {
- "nvim-treesitter/nvim-treesitter",
- build = ":TSUpdate",
- config = function()
- local configs = require("nvim-treesitter.configs")
- configs.setup {
- ensure_installed = { "go", "javascript", "typescript", "json", "yaml", "html", "css", "lua", "bash"
- },
- highlight = {
- enable = true,
- },
- indent = {
- enable = true,
- },
- }
- end
- }
- === lua/plugins/trouble.lua ===
- -- Diagnostics UI
- return {
- "folke/trouble.nvim",
- opts = {},
- dependencies = { "nvim-tree/nvim-web-devicons" },
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement