From 0ed3799eec248a1651a3445944f829678f869723 Mon Sep 17 00:00:00 2001 From: speedie Date: Thu, 8 Feb 2024 20:43:47 +0100 Subject: [PATCH] speedie-nvim | Add new config --- .config/nvim/init.lua | 14 ++++++++++++-- .config/nvim/lua/bootstrap.lua | 4 ---- .config/nvim/lua/compiler_config.lua | 7 +++++++ .config/nvim/lua/project_config.lua | 6 ++++++ .config/nvim/lua/setup.lua | 2 ++ .config/nvim/lua/telescope_config.lua | 2 ++ .config/nvim/lua/tree_config.lua | 6 ++++++ 7 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 .config/nvim/lua/compiler_config.lua create mode 100644 .config/nvim/lua/project_config.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index d7f317c..4ae87d1 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -3,6 +3,7 @@ -- https://git.speedie.site/speedie/speedie-nvim -- ]]-- +local g = vim.g -- Convenient alias local opt = vim.opt -- Convenient alias local keymap = vim.api.nvim_set_keymap -- Convenient alias local autocmd = vim.api.nvim_create_autocmd -- Convenient alias @@ -11,7 +12,6 @@ local defaultKeybindOptions = { noremap = true, silent = true } -- Default keybi LoadPreviousSessionOnLoad = true -- Load previous session or not EnableImageSupport = false -- Enable image support or not ImageBackend = 'kitty' -- Image backend to support (kitty/ueberzug) -LeaderKey = ' ' -- The leader key to use. MaxAccelerationSpeed = 300 -- Max speed for j/k/gj/gk bindings. Theme = 'oxocarbon' -- Theme to use Languages = { -- Languages to support - Used to configure highlighting @@ -80,6 +80,12 @@ Plugins = { -- Plugins to use }, }, -- Indentation blankline { 'uga-rosa/translate.nvim' }, -- Built in translate + { 'ahmedkhalf/project.nvim', + dependencies = { + 'stevearc/overseer.nvim', + }, + }, -- Project manager + { 'Zeioth/compiler.nvim' }, -- Compiler { 'folke/trouble.nvim' }, -- Display warnings and errors neatly { 'folke/noice.nvim', event = 'VeryLazy', dependencies = { @@ -126,6 +132,8 @@ opt.autochdir = true -- Automatically change directory to the file we're editing opt.fillchars = { -- Display tab indents using this character vert = '▏', } +g.mapleader = ' ' -- Leader key +g.maplocalleader = ' ' -- Leader key -- Keybinds for handling splits keymap('n', '', 'h', defaultKeybindOptions) -- Move left @@ -172,6 +180,8 @@ keymap('n', ',', 'AerialToggle', keymap('n', 'G', 'Neogit', defaultKeybindOptions) -- Toggle Neogit keymap('n', 'gt', 'Gitsigns toggle_current_line_blame', defaultKeybindOptions) -- Toggle current line blame keymap('n', '', 'Telescope fd', defaultKeybindOptions) -- Toggle Telescope file opener +keymap('n', 'P', 'Telescope projects', defaultKeybindOptions) -- Toggle Telescope project opener +keymap('n', ';', 'CompilerOpen', defaultKeybindOptions) -- Toggle compiler options -- Keybinds for handling tabs keymap('n', '', 'BufferLineCyclePrev', defaultKeybindOptions) -- Cycle previous @@ -205,4 +215,4 @@ autocmd('BufReadPre', { -- Enable spell check for all Markdown files end, }) -require('bootstrap') -- Set up Lazy and plugins. +require('bootstrap') -- Set up Lazy and plugins. Has to be done before keybinds are defined. diff --git a/.config/nvim/lua/bootstrap.lua b/.config/nvim/lua/bootstrap.lua index 9b236c3..0108fb3 100644 --- a/.config/nvim/lua/bootstrap.lua +++ b/.config/nvim/lua/bootstrap.lua @@ -3,10 +3,6 @@ -- https://git.speedie.site/speedie/speedie-nvim -- ]]-- -vim.api.nvim_set_keymap('', LeaderKey, '', { noremap = true, silent = true }) -vim.g.mapleader = LeaderKey -vim.g.maplocalleader = LeaderKey - local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' if not vim.loop.fs_stat(lazypath) then vim.fn.system({ diff --git a/.config/nvim/lua/compiler_config.lua b/.config/nvim/lua/compiler_config.lua new file mode 100644 index 0000000..b1da07f --- /dev/null +++ b/.config/nvim/lua/compiler_config.lua @@ -0,0 +1,7 @@ +--[[ + speedie's neovim configuration + -- https://git.speedie.site/speedie/speedie-nvim -- +]]-- + +require('overseer').setup({}) +require('compiler').setup({}) diff --git a/.config/nvim/lua/project_config.lua b/.config/nvim/lua/project_config.lua new file mode 100644 index 0000000..b9ca67c --- /dev/null +++ b/.config/nvim/lua/project_config.lua @@ -0,0 +1,6 @@ +--[[ + speedie's neovim configuration + -- https://git.speedie.site/speedie/speedie-nvim -- +]]-- + +require('project_nvim').setup({}) diff --git a/.config/nvim/lua/setup.lua b/.config/nvim/lua/setup.lua index 8769736..5c716f7 100644 --- a/.config/nvim/lua/setup.lua +++ b/.config/nvim/lua/setup.lua @@ -26,6 +26,8 @@ require('neogit_config') require('gitsigns_config') require('noice_config') require('whichkey_config') +require('project_config') +require('compiler_config') require('colorizer_config') require('illuminate_config') require('swapbuffers_config') diff --git a/.config/nvim/lua/telescope_config.lua b/.config/nvim/lua/telescope_config.lua index 04b5f10..336990e 100644 --- a/.config/nvim/lua/telescope_config.lua +++ b/.config/nvim/lua/telescope_config.lua @@ -2,4 +2,6 @@ speedie's neovim configuration -- https://git.speedie.site/speedie/speedie-nvim -- ]]-- + require('telescope').setup({}) +require('telescope').load_extension('projects') diff --git a/.config/nvim/lua/tree_config.lua b/.config/nvim/lua/tree_config.lua index 4d027fd..42fea90 100644 --- a/.config/nvim/lua/tree_config.lua +++ b/.config/nvim/lua/tree_config.lua @@ -13,4 +13,10 @@ require("nvim-tree").setup({ filters = { dotfiles = true, }, + sync_root_with_cwd = true, + respect_buf_cwd = true, + update_focused_file = { + enable = true, + update_root = true, + }, })