From 31b43f802af517b729a90766aa380af535c50c20 Mon Sep 17 00:00:00 2001 From: lukegriffith Date: Sun, 3 Mar 2024 12:07:45 +0000 Subject: [PATCH] Adding my configuration --- init.lua | 73 +++++++++++++++++++++++++++++++++++-- lazyvim.json | 9 +++++ lua/custom/plugins/init.lua | 55 +++++++++++++++++++++++++++- 3 files changed, 133 insertions(+), 4 deletions(-) create mode 100644 lazyvim.json diff --git a/init.lua b/init.lua index 292ec077..95080f25 100644 --- a/init.lua +++ b/init.lua @@ -148,6 +148,66 @@ vim.opt.cursorline = true -- Minimal number of screen lines to keep above and below the cursor. vim.opt.scrolloff = 10 +-- Custom Options +local opt = vim.opt + +-- Set highlight on search +opt.hlsearch = false + +-- Make line numbers default +opt.number = true +opt.relativenumber = true + +-- Enable mouse mode +opt.mouse = 'a' + +-- Sync clipboard between OS and Neovim. +-- Remove this option if you want your OS clipboard to remain independent. +-- See `:help 'clipboard'` +opt.clipboard = 'unnamedplus' + +-- Enable break indent +opt.breakindent = true + +-- Save undo history +opt.undofile = true + +-- Case insensitive searching UNLESS /C or capital in search +opt.ignorecase = true +opt.smartcase = true + +-- Keep signcolumn on by default +opt.signcolumn = 'yes' + +-- Decrease update time +opt.updatetime = 250 +opt.timeout = true +opt.timeoutlen = 300 + +-- Set completeopt to have a better completion experience +opt.completeopt = 'menuone,noselect' + +-- NOTE: You should make sure your terminal supports this +opt.termguicolors = true + +opt.wildmenu = true +opt.wildmode = 'longest,list,full' +opt.showmatch = true +opt.hlsearch = true + +opt.splitbelow = true +opt.splitright = true + +-- not neeeded with sleuth ? +vim.o.tabstop = 2 +vim.o.expandtab = false +opt.backspace = 'indent,eol,start' + +--opt.tabstop = 2 +vim.o.shiftwidth = 2 + +--- END custom options + -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -184,6 +244,13 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +--- CUSTOM KEYMAPS + +-- nvim tree +vim.keymap.set('n', 'e', vim.cmd.NvimTreeToggle, { desc = 'Toggle [E]xplorer' }) + +-- END CUSTOM KEYMAPS + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -532,7 +599,7 @@ require('lazy').setup { -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { -- clangd = {}, - -- gopls = {}, + gopls = {}, -- pyright = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs @@ -806,7 +873,7 @@ require('lazy').setup { -- Here are some example plugins that I've included in the kickstart repository. -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- - -- require 'kickstart.plugins.debug', + require 'kickstart.plugins.debug', -- require 'kickstart.plugins.indent_line', -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` @@ -814,7 +881,7 @@ require('lazy').setup { -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, } -- The line beneath this is called `modeline`. See `:help modeline` diff --git a/lazyvim.json b/lazyvim.json new file mode 100644 index 00000000..ff6a1393 --- /dev/null +++ b/lazyvim.json @@ -0,0 +1,9 @@ +{ + "extras": [ + + ], + "news": { + "NEWS.md": "2123" + }, + "version": 2 +} \ No newline at end of file diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8..26fbcb62 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,57 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + { + 'alexghergh/nvim-tmux-navigation', + config = function() + local nvim_tmux_nav = require 'nvim-tmux-navigation' + vim.keymap.set('n', '', nvim_tmux_nav.NvimTmuxNavigateLeft) + vim.keymap.set('n', '', nvim_tmux_nav.NvimTmuxNavigateDown) + vim.keymap.set('n', '', nvim_tmux_nav.NvimTmuxNavigateUp) + vim.keymap.set('n', '', nvim_tmux_nav.NvimTmuxNavigateRight) + vim.keymap.set('n', '', nvim_tmux_nav.NvimTmuxNavigateLastActive) + vim.keymap.set('n', '', nvim_tmux_nav.NvimTmuxNavigateNext) + + nvim_tmux_nav.setup { + disable_when_zoomed = true, -- defaults to false + } + end, + keys = { + { '', 'TmuxNavigatePrevious', desc = 'Go to the previous pane' }, + { '', 'TmuxNavigateLeft', desc = 'Got to the left pane' }, + { '', 'TmuxNavigateDown', desc = 'Got to the down pane' }, + { '', 'TmuxNavigateUp', desc = 'Got to the up pane' }, + { '', 'TmuxNavigateRight', desc = 'Got to the right pane' }, + }, + }, + 'nvim-tree/nvim-tree.lua', + 'nvim-tree/nvim-web-devicons', + + { + 'utilyre/barbecue.nvim', + config = function() + require('barbecue').setup() + end, + dependencies = { + 'SmiteshP/nvim-navic', + 'nvim-tree/nvim-web-devicons', -- optional dependency + }, + }, + { 'catppuccin/nvim', name = 'catppuccin' }, + { + 'LazyVim/LazyVim', + opts = { + colorscheme = 'catppuccin', + }, + }, + { + 'folke/todo-comments.nvim', + dependencies = { 'nvim-lua/plenary.nvim' }, + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, + }, +}