Skip to content

Commit

Permalink
feat: overhaul nvim config
Browse files Browse the repository at this point in the history
- add lazyvim config and place them to xdg config path (~/.config)
- remove old nvim directory
  • Loading branch information
tokuda109 committed Jan 30, 2024
1 parent b6f468e commit a634aaa
Show file tree
Hide file tree
Showing 31 changed files with 192 additions and 402 deletions.
1 change: 1 addition & 0 deletions .config/nvim/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require("config.lazy")
52 changes: 52 additions & 0 deletions .config/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"LazyVim": { "branch": "main", "commit": "c433ea7aa842c446edc2b1570998bf5440c68188" },
"LuaSnip": { "branch": "master", "commit": "2dbef19461198630b3d7c39f414d09fb07d1fdd2" },
"bufferline.nvim": { "branch": "main", "commit": "b15c6daf5a64426c69732b31a951f4e438cb6590" },
"catppuccin": { "branch": "main", "commit": "c2e6f8e7eb8d0ebf55700c89bdf842809aeecf09" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform.nvim": { "branch": "master", "commit": "4588008a7c5b57fbff97fdfb529c059235cdc7ee" },
"dashboard-nvim": { "branch": "master", "commit": "63df28409d940f9cac0a925df09d3dc369db9841" },
"dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" },
"flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
"friendly-snippets": { "branch": "main", "commit": "b8fae73a479ae0a1c54f5c98fa687ae8a0addc53" },
"gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
"indent-blankline.nvim": { "branch": "master", "commit": "12e92044d313c54c438bd786d11684c88f6f78cd" },
"lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" },
"lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "b9084b1f42f790d6230dc66dbcb6bcc35b148552" },
"mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" },
"mini.ai": { "branch": "main", "commit": "3ad9d455a91b8bf3c24d4e50518d9a6b9dddb42c" },
"mini.bufremove": { "branch": "main", "commit": "020243bfed8c8b941f2c20626faf3ea39c0c0e1b" },
"mini.comment": { "branch": "main", "commit": "67f00d3ebbeae15e84584d971d0c32aad4f4f3a4" },
"mini.pairs": { "branch": "main", "commit": "552062017ff207e1f35f7028bfb3f27c7421d22d" },
"mini.surround": { "branch": "main", "commit": "5ceb6a12d3761bc719fbdad5432c89333deb1498" },
"neoconf.nvim": { "branch": "main", "commit": "bf04719b3b25ba5f6a059c0a10ee67e5996bdc4c" },
"neodev.nvim": { "branch": "main", "commit": "345ed5843405126464119154f394d4298c1314c7" },
"noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" },
"nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" },
"nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" },
"nvim-lint": { "branch": "master", "commit": "8e5920f9ce9f24c283a2e64be5fe58d1d37d1744" },
"nvim-lspconfig": { "branch": "master", "commit": "021906284dcfb938bc236f8295af2650c60cb807" },
"nvim-notify": { "branch": "master", "commit": "80b67b265530632505193553d05127ae7fe09ddd" },
"nvim-spectre": { "branch": "master", "commit": "d958cc3ea8b3fb2f0922dff6177630a40751a3a9" },
"nvim-treesitter": { "branch": "master", "commit": "e9602f41192ba51842b4be4d02c718a64cd57acf" },
"nvim-treesitter-context": { "branch": "master", "commit": "9c06b115abc57c99cf0aa81dc29490f5001f57a1" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "19a91a38b02c1c28c14e0ba468d20ae1423c39b2" },
"nvim-ts-autotag": { "branch": "main", "commit": "a65b202cfd08e0e69e531eab737205ff5bc082a4" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1277b4a1f451b0f18c0790e1a7f12e1e5fdebfee" },
"nvim-web-devicons": { "branch": "master", "commit": "aaec87dbdaa776bfa0a13c8694bec9bcb7454719" },
"persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" },
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
"solarized-osaka.nvim": { "branch": "main", "commit": "f6e66670e31c09cfb7142a16d5dc2f26d2a31a40" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
"telescope.nvim": { "branch": "master", "commit": "e54fbf4ab2b64640b639b75c006c23b4bc51c86f" },
"todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" },
"tokyonight.nvim": { "branch": "main", "commit": "e3301873c1e96903daebb98cc9b5926810bf73dd" },
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
"vim-illuminate": { "branch": "master", "commit": "97c1265ff0b67064b6cfdc15bafc50202a537ae2" },
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
}
9 changes: 9 additions & 0 deletions .config/nvim/lazyvim.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extras": [

],
"news": {
"NEWS.md": "2123"
},
"version": 2
}
3 changes: 3 additions & 0 deletions .config/nvim/lua/config/autocmds.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
-- Add any additional autocmds here
20 changes: 20 additions & 0 deletions .config/nvim/lua/config/keymaps.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here

-- Window navigation
vim.keymap.set("n", "<Leader>h", "<C-w>h")
vim.keymap.set("n", "<Leader>j", "<C-w>j")
vim.keymap.set("n", "<Leader>k", "<C-w>k")
vim.keymap.set("n", "<Leader>l", "<C-w>l")

-- Cursor movement
vim.keymap.set("n", "<S-h>", "0")
vim.keymap.set("n", "<S-l>", "$")

-- Increment/decrement
vim.keymap.set("n", "+", "<C-a>")
vim.keymap.set("n", "-", "<C-x>")

-- Reload init.lua without restarting neovim
vim.keymap.set('n', '<Leader>r', '<Cmd>source $MYVIMRC<CR> | <Cmd>echo "$MYVIMRC reloaded"<CR>', opt)
30 changes: 30 additions & 0 deletions .config/nvim/lua/config/lazy.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
-- bootstrap lazy.nvim
-- stylua: ignore
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath
})
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)

require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{
"LazyVim/LazyVim",
import = "lazyvim.plugins",
},
-- import/override with your plugins
{
import = "plugins",
},
},
defaults = {},
checker = { enabled = true }, -- automatically check for plugin updates
})
39 changes: 39 additions & 0 deletions .config/nvim/lua/config/options.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here

-- Encoding
vim.scriptencoding = "utf-8"
vim.opt.encoding = "utf-8"
vim.opt.fileencoding = "utf-8"

-- Show line number
vim.opt.number = true
vim.opt.relativenumber = false

-- Enable line wrapping
vim.opt.wrap = true
vim.opt.linebreak = true

-- Highlight the current cursor line
vim.opt.cursorline = true
-- Set default background color
vim.opt.background = "dark"
-- Enable 24-bit RGB colors
vim.opt.termguicolors = true

-- Indent new line with C syntax primitives
vim.opt.smartindent = true
-- Autoindent new line
vim.opt.autoindent = true
-- Preserve indent on wrapped lines
vim.opt.breakindent = true

-- 2 spaces for tabs
vim.opt.tabstop = 2
-- 2 spaces for indent width
vim.opt.shiftwidth = 2
--
vim.opt.smarttab = true
-- Insert space character
vim.opt.expandtab = true
13 changes: 13 additions & 0 deletions .config/nvim/lua/plugins/colorscheme.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
return {
{
"craftzdog/solarized-osaka.nvim",
lazy = true,
priority = 1000,
},
{
"LazyVim/LazyVim",
opts = {
colorscheme = "solarized-osaka",
},
},
}
4 changes: 4 additions & 0 deletions .config/nvim/lua/plugins/mini-indentscope.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Disable indent animation
return {
{ "echasnovski/mini.indentscope", enabled = false }
}
4 changes: 4 additions & 0 deletions .config/nvim/lua/plugins/neo-tree.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Disable neo-tree
return {
{ "nvim-neo-tree/neo-tree.nvim", enabled = false }
}
16 changes: 16 additions & 0 deletions .config/nvim/lua/plugins/treesitter.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"astro",
"css",
"dockerfile",
"fish",
"go",
"graphql",
"rust",
}
}
}
}
3 changes: 0 additions & 3 deletions nvim/init.lua

This file was deleted.

31 changes: 0 additions & 31 deletions nvim/lua/base.lua

This file was deleted.

30 changes: 0 additions & 30 deletions nvim/lua/mappings.lua

This file was deleted.

13 changes: 0 additions & 13 deletions nvim/lua/plugins/_autopairs.lua

This file was deleted.

11 changes: 0 additions & 11 deletions nvim/lua/plugins/_bufferline.lua

This file was deleted.

11 changes: 0 additions & 11 deletions nvim/lua/plugins/_colorscheme.lua

This file was deleted.

6 changes: 0 additions & 6 deletions nvim/lua/plugins/_comment.lua

This file was deleted.

1 change: 0 additions & 1 deletion nvim/lua/plugins/_emmet.lua

This file was deleted.

7 changes: 0 additions & 7 deletions nvim/lua/plugins/_gitsigns.lua

This file was deleted.

12 changes: 0 additions & 12 deletions nvim/lua/plugins/_hop.lua

This file was deleted.

9 changes: 0 additions & 9 deletions nvim/lua/plugins/_indent_blankline.lua

This file was deleted.

Loading

0 comments on commit a634aaa

Please sign in to comment.