diff options
| -rw-r--r-- | nvim/.config/nvim/init.lua | 42 | ||||
| -rw-r--r-- | nvim/.config/nvim/lazy-lock.json | 17 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/bard/plugins/autopairs.lua | 7 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/bard/plugins/comment.lua | 10 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/bard/plugins/gruber-darker.lua | 9 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/bard/plugins/nvim-tree.lua | 60 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/bard/plugins/nvim-treesitter.lua | 14 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/bard/plugins/telescope.lua | 73 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/bard/plugins/tmux-navigator.lua | 17 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/bard/plugins/which-key.lua | 13 | ||||
| -rw-r--r-- | nvim/.config/nvim/lualine.lua | 10 |
11 files changed, 272 insertions, 0 deletions
diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua new file mode 100644 index 0000000..caaa1b0 --- /dev/null +++ b/nvim/.config/nvim/init.lua @@ -0,0 +1,42 @@ +vim.g.mapleader = ' ' + +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or 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("bard.plugins") + +vim.cmd.colorscheme("gruber-darker") + +vim.opt.clipboard = 'unnamedplus' +vim.opt.number = true +vim.opt.relativenumber = true +vim.opt.expandtab = true +vim.opt.shiftwidth = 4 +vim.opt.tabstop = 4 +vim.opt.expandtab = true +vim.opt.shiftwidth = 4 +vim.opt.tabstop = 4 + +-- nvim-tree binds +vim.api.nvim_set_keymap('n', '<leader>e', ':NvimTreeToggle<CR>', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', '<C-h>', '<C-w>h', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', '<C-j>', '<C-w>j', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', '<C-k>', '<C-w>k', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', '<C-l>', '<C-w>l', { noremap = true, silent = true }) + +-- telescope binds +local builtin = require('telescope.builtin') +vim.keymap.set('n', '<leader>ff', builtin.find_files, {}) +vim.keymap.set('n', '<leader>fg', builtin.live_grep, {}) +vim.keymap.set('n', '<leader>fb', builtin.buffers, {}) +vim.keymap.set('n', '<leader>fh', builtin.help_tags, {}) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..6134c8d --- /dev/null +++ b/nvim/.config/nvim/lazy-lock.json @@ -0,0 +1,17 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, + "gruber-darker.nvim": { "branch": "main", "commit": "a2dda61d9c1225e16951a51d6b89795b0ac35cd6" }, + "gruvbox.nvim": { "branch": "main", "commit": "68c3460a5d1d1a362318960035c9f3466d5011f5" }, + "harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" }, + "lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" }, + "nvim-autopairs": { "branch": "master", "commit": "3d02855468f94bf435db41b661b58ec4f48a06b7" }, + "nvim-tree.lua": { "branch": "master", "commit": "d529a99f88e0dff02e0aa275db2f595cd252a2c8" }, + "nvim-treesitter": { "branch": "master", "commit": "984214ef8e4ca18d77639663319aabdfba89632f" }, + "nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" }, + "plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" }, + "ripgrep": { "branch": "master", "commit": "d6b59feff890f038acde7d5e151995d8aec1e107" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, + "telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" }, + "vim-tmux-navigator": { "branch": "master", "commit": "d847ea942a5bb4d4fab6efebc9f30d787fd96e65" }, + "which-key.nvim": { "branch": "main", "commit": "1f8d414f61e0b05958c342df9b6a4c89ce268766" } +} diff --git a/nvim/.config/nvim/lua/bard/plugins/autopairs.lua b/nvim/.config/nvim/lua/bard/plugins/autopairs.lua new file mode 100644 index 0000000..596e844 --- /dev/null +++ b/nvim/.config/nvim/lua/bard/plugins/autopairs.lua @@ -0,0 +1,7 @@ +return { + 'windwp/nvim-autopairs', + event = "InsertEnter", + config = true + -- use opts = {} for passing setup options + -- this is equalent to setup({}) function +} diff --git a/nvim/.config/nvim/lua/bard/plugins/comment.lua b/nvim/.config/nvim/lua/bard/plugins/comment.lua new file mode 100644 index 0000000..b954dea --- /dev/null +++ b/nvim/.config/nvim/lua/bard/plugins/comment.lua @@ -0,0 +1,10 @@ +return { + 'numToStr/Comment.nvim', + opts = { + -- add any options here + }, + lazy = false, + config = function() + require('Comment').setup() + end +} diff --git a/nvim/.config/nvim/lua/bard/plugins/gruber-darker.lua b/nvim/.config/nvim/lua/bard/plugins/gruber-darker.lua new file mode 100644 index 0000000..1008b05 --- /dev/null +++ b/nvim/.config/nvim/lua/bard/plugins/gruber-darker.lua @@ -0,0 +1,9 @@ +return { + "blazkowolf/gruber-darker.nvim", + opts = { + bold = false, + italic = { + strings = false, + }, + }, +} diff --git a/nvim/.config/nvim/lua/bard/plugins/nvim-tree.lua b/nvim/.config/nvim/lua/bard/plugins/nvim-tree.lua new file mode 100644 index 0000000..ff002fa --- /dev/null +++ b/nvim/.config/nvim/lua/bard/plugins/nvim-tree.lua @@ -0,0 +1,60 @@ +return { + "nvim-tree/nvim-tree.lua", + dependencies = { + "nvim-tree/nvim-web-devicons" + }, + config = function() + 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() + + -- OR setup with some options + require("nvim-tree").setup({ + sort = { + sorter = "case_sensitive", + }, + view = { + width = 30, + }, + renderer = { + group_empty = true, + }, + filters = { + dotfiles = true, + }, + }) + + require("nvim-tree").setup({ + renderer = { + icons = { + show = { + git = true, + file = false, + folder = false, + folder_arrow = true, + }, + glyphs = { + folder = { + arrow_closed = "⏵", + arrow_open = "⏷", + }, + git = { + unstaged = "✗", + staged = "✓", + unmerged = "⌥", + renamed = "➜", + untracked = "★", + deleted = "⊖", + ignored = "◌", + }, + }, + }, + }, + }) + end +} diff --git a/nvim/.config/nvim/lua/bard/plugins/nvim-treesitter.lua b/nvim/.config/nvim/lua/bard/plugins/nvim-treesitter.lua new file mode 100644 index 0000000..53cfdd0 --- /dev/null +++ b/nvim/.config/nvim/lua/bard/plugins/nvim-treesitter.lua @@ -0,0 +1,14 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function () + local configs = require("nvim-treesitter.configs") + + configs.setup({ + ensure_installed = { "c", "lua", "vim", "vimdoc", "cpp", "html" }, + sync_install = false, + highlight = { enable = true }, + indent = { enable = true }, + }) + end +} diff --git a/nvim/.config/nvim/lua/bard/plugins/telescope.lua b/nvim/.config/nvim/lua/bard/plugins/telescope.lua new file mode 100644 index 0000000..2394408 --- /dev/null +++ b/nvim/.config/nvim/lua/bard/plugins/telescope.lua @@ -0,0 +1,73 @@ +return { + { + 'nvim-telescope/telescope.nvim', + dependencies = { + { 'BurntSushi/ripgrep', 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' } + }, + config = function(lazy, opts) + local telescope = require('telescope') + telescope.load_extension('fzf') + telescope.setup({ + defaults = { + wrap_result = true, + mappings = { + i = { + ["<esc>"] = require("telescope.actions").close, + -- search history + ["<C-Down>"] = require('telescope.actions').cycle_history_next, + ["<C-Up>"] = require('telescope.actions').cycle_history_prev, + }, + }, + layout_strategy = "vertical", + layout_config = { + vertical = { + width = 0.9, + preview_cutoff = 10, + } + } + }, + pickers = { + -- note: remove the 'builtin.' prefix. + ["lsp_references"] = { wrap_results = true, }, + ["lsp_definitions"] = { wrap_results = true, }, + ["diagnostics"] = { wrap_results = true, }, + ["find_files"] = { wrap_results = true, }, + ["buffers"] = { sort_mru = true, ignore_current_buffer = true }, + } + }) + end, + + keys = { + -- See :help telescope.builtin + { '<leader>fo', function() + require("telescope.builtin").oldfiles { + prompt_title = 'Recent files', + sort_mru= true + } end, + desc = "Old (recent) files"}, + {'<leader><space>', '<cmd>Telescope buffers<cr>', desc = "Buffers"}, + {'<leader>b', '<cmd>Telescope buffers<cr>', desc = "Buffers"}, + {'<leader>p', '<cmd>Telescope buffers<cr>', desc = "Buffers"}, + + {'<leader>ff', '<cmd>Telescope find_files<cr>', desc = "Find filenames"}, + {'<leader>fm', '<cmd>Telescope marks<cr>', desc = "Marks"}, + {'<leader>fw', '<cmd>Telescope live_grep<cr>', desc = "Grep files"}, + {'<leader>ld', '<cmd>Telescope diagnostics<cr>', desc = "diagnostics"}, + {"<leader>fb", function() + require("telescope.builtin").live_grep { + prompt_title = 'grep open files', + grep_open_files = true } + end, desc = "Grep open files"}, + {"<leader>fc", function() require("telescope.builtin").current_buffer_fuzzy_find() end, desc = "Grep this file"}, + {"<leader>:", function() require("telescope.builtin").command_history { prompt_title = 'Command history' } end, desc = "cmd history"}, + { "<leader>ls", function() + local aerial_avail, _ = pcall(require, "aerial") + if aerial_avail then + require("telescope").extensions.aerial.aerial() + else + require("telescope.builtin").lsp_document_symbols() + end + end, desc = "Search symbols" }, + } + } +} diff --git a/nvim/.config/nvim/lua/bard/plugins/tmux-navigator.lua b/nvim/.config/nvim/lua/bard/plugins/tmux-navigator.lua new file mode 100644 index 0000000..4421fed --- /dev/null +++ b/nvim/.config/nvim/lua/bard/plugins/tmux-navigator.lua @@ -0,0 +1,17 @@ +return { + "christoomey/vim-tmux-navigator", + cmd = { + "TmuxNavigateLeft", + "TmuxNavigateDown", + "TmuxNavigateUp", + "TmuxNavigateRight", + "TmuxNavigatePrevious", + }, + keys = { + { "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" }, + { "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" }, + { "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" }, + { "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" }, + { "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" }, + }, +} diff --git a/nvim/.config/nvim/lua/bard/plugins/which-key.lua b/nvim/.config/nvim/lua/bard/plugins/which-key.lua new file mode 100644 index 0000000..6f820e0 --- /dev/null +++ b/nvim/.config/nvim/lua/bard/plugins/which-key.lua @@ -0,0 +1,13 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + end, + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + } +} diff --git a/nvim/.config/nvim/lualine.lua b/nvim/.config/nvim/lualine.lua new file mode 100644 index 0000000..7ce8332 --- /dev/null +++ b/nvim/.config/nvim/lualine.lua @@ -0,0 +1,10 @@ +-- return { +-- 'nvim-lualine/lualine.nvim', +-- dependencies = { 'nvim-tree/nvim-web-devicons' }, +-- config = function() +-- require('lualine').setup { +-- options = { theme = 'gruvbox_dark' } +-- } +-- end +-- } + |
