diff --git a/.gitmodules b/.gitmodules index a21ce25..4a4c96c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -61,3 +61,6 @@ [submodule "zsh/oh-my-zsh"] path = zsh/oh-my-zsh url = https://github.com/ohmyzsh/ohmyzsh.git +[submodule "nvim/lua/lazy"] + path = nvim/lua/lazy + url = https://github.com/folke/lazy.nvim.git diff --git a/install.conf.yaml b/install.conf.yaml index 34614b3..188ef43 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -7,6 +7,7 @@ - create: - ~/.profile.d - ~/.local/bin + - ~/.local/share - ~/.config/alacritty - ~/.config/environment.d - ~/.config/foot @@ -53,6 +54,7 @@ ~/.vimrc: vim/vimrc ~/.vim/pack/dotfiles/start: vim/start ~/.vim/colors/badwolf.vim: vim/start/badwolf/colors/badwolf.vim + ~/.config/nvim: nvim ~/.wgetrc: wget/wgetrc ~/.config/yay/config.json: yay/config.json ~/.Xresources: i3/Xresources diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..1587224 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,6 @@ +require("config.lazy") + +-- old vim config +vim.opt.number = true +vim.opt.expandtab = true +vim.opt.shiftwidth = 2 diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json new file mode 100644 index 0000000..cf5ca3f --- /dev/null +++ b/nvim/lazy-lock.json @@ -0,0 +1,12 @@ +{ + "gitsigns.nvim": { "branch": "main", "commit": "42d6aed4e94e0f0bbced16bbdcc42f57673bd75e" }, + "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, + "nvim-autopairs": { "branch": "master", "commit": "c2a0dd0d931d0fb07665e1fedb1ea688da3b80b4" }, + "nvim-treesitter": { "branch": "main", "commit": "d19def46c112c26c17adeef88dd1253cc6d623a1" }, + "nvim-web-devicons": { "branch": "master", "commit": "803353450c374192393f5387b6a0176d0972b848" }, + "onedark.nvim": { "branch": "master", "commit": "213c23ae45a04797572242568d5d51937181792d" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, + "telescope.nvim": { "branch": "master", "commit": "a8c2223ea6b185701090ccb1ebc7f4e41c4c9784" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" } +} diff --git a/nvim/lua/config/gitsigns.lua b/nvim/lua/config/gitsigns.lua new file mode 100644 index 0000000..4eea3aa --- /dev/null +++ b/nvim/lua/config/gitsigns.lua @@ -0,0 +1,9 @@ +require('gitsigns').setup { + signs = { + add = { text = '+' }, + change = { text = '~' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + }, +} diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..18d8e56 --- /dev/null +++ b/nvim/lua/config/lazy.lua @@ -0,0 +1,28 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("config") .. "/lua/lazy" +if not vim.loop.fs_stat(lazypath) then + -- Submodule should exist, but fail gracefully + vim.notify("lazy.nvim submodule not found!", vim.log.levels.ERROR) +end +vim.opt.rtp:prepend(lazypath) + +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + -- import your plugins + { import = "plugins" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "onedark" } }, + -- automatically check for plugin updates + checker = { enabled = true }, + -- disable luarocks + rocks = { enabled = false }, +}) diff --git a/nvim/lua/config/lualine.lua b/nvim/lua/config/lualine.lua new file mode 100644 index 0000000..8a17d9b --- /dev/null +++ b/nvim/lua/config/lualine.lua @@ -0,0 +1,6 @@ +require('lualine').setup { + options = { + icons_enabled = true, + theme = 'onedark' + } +} diff --git a/nvim/lua/config/telescope.lua b/nvim/lua/config/telescope.lua new file mode 100644 index 0000000..0addaed --- /dev/null +++ b/nvim/lua/config/telescope.lua @@ -0,0 +1,32 @@ +-- [[ Configure Telescope ]] +-- See `:help telescope` and `:help telescope.setup()` +require('telescope').setup { + defaults = { + mappings = { + i = { + [''] = false, + [''] = false, + }, + }, + }, +} + +-- Enable telescope fzf native, if installed +require('telescope').load_extension('fzf') + +-- See `:help telescope.builtin` +vim.keymap.set('n', '?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) +vim.keymap.set('n', '', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) +vim.keymap.set('n', '/', function() + -- You can pass additional configuration to telescope to change theme, layout, etc. + require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + winblend = 10, + previewer = false, + }) +end, { desc = '[/] Fuzzily search in current buffer]' }) + +vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) +vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) +vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) +vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) +vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) diff --git a/nvim/lua/config/treesitter.lua b/nvim/lua/config/treesitter.lua new file mode 100644 index 0000000..9f28ee8 --- /dev/null +++ b/nvim/lua/config/treesitter.lua @@ -0,0 +1,15 @@ +-- [[ Configure Treesitter ]] +-- See `:help nvim-treesitter` +require('nvim-treesitter').install({ + "bash", + "comment", + "json", + "lua", + "markdown_inline", + "markdown", + "python", + "rust", + "vim", + "yaml", + "zsh", +}) diff --git a/nvim/lua/lazy b/nvim/lua/lazy new file mode 160000 index 0000000..306a055 --- /dev/null +++ b/nvim/lua/lazy @@ -0,0 +1 @@ +Subproject commit 306a05526ada86a7b30af95c5cc81ffba93fef97 diff --git a/nvim/lua/plugins/autopairs.lua b/nvim/lua/plugins/autopairs.lua new file mode 100644 index 0000000..27a35b8 --- /dev/null +++ b/nvim/lua/plugins/autopairs.lua @@ -0,0 +1,5 @@ +return { + 'windwp/nvim-autopairs', + event = "InsertEnter", + config = true, +} diff --git a/nvim/lua/plugins/gitsigns.lua b/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..19809aa --- /dev/null +++ b/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,6 @@ +return { + 'lewis6991/gitsigns.nvim', + config = function() + require("config.gitsigns") + end, +} diff --git a/nvim/lua/plugins/lualine.lua b/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..88dfda2 --- /dev/null +++ b/nvim/lua/plugins/lualine.lua @@ -0,0 +1,7 @@ +return { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + require("config.lualine") + end, +} diff --git a/nvim/lua/plugins/onedark.lua b/nvim/lua/plugins/onedark.lua new file mode 100644 index 0000000..f70dbdd --- /dev/null +++ b/nvim/lua/plugins/onedark.lua @@ -0,0 +1,10 @@ +return { + "navarasu/onedark.nvim", + priority = 1000, -- make sure to load this before all the other start plugins + config = function() + require('onedark').setup { + style = 'warmer' + } + require('onedark').load() + end +} diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..d2e7e89 --- /dev/null +++ b/nvim/lua/plugins/telescope.lua @@ -0,0 +1,23 @@ +return { + 'nvim-telescope/telescope.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + -- optional but recommended + { -- If encountering errors, see telescope-fzf-native README for installation instructions + 'nvim-telescope/telescope-fzf-native.nvim', + + -- `build` is used to run some command when the plugin is installed/updated. + -- This is only run then, not every time Neovim starts up. + build = 'make', + + -- `cond` is a condition used to determine whether this plugin should be + -- installed and loaded. + cond = function() + return vim.fn.executable 'make' == 1 + end, + }, + }, + config = function() + require("config.telescope") + end, +} diff --git a/nvim/lua/plugins/todo-comments.lua b/nvim/lua/plugins/todo-comments.lua new file mode 100644 index 0000000..0c4e1b2 --- /dev/null +++ b/nvim/lua/plugins/todo-comments.lua @@ -0,0 +1,6 @@ +return { + "folke/todo-comments.nvim", + event = 'VimEnter', + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { signs = false }, +} diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..82d71e1 --- /dev/null +++ b/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,8 @@ +return { + 'nvim-treesitter/nvim-treesitter', + lazy = false, + build = ':TSUpdate', + config = function() + require("config.treesitter") + end, +}