mirror of
https://github.com/danbee/dotfiles-local
synced 2025-03-04 08:49:07 +00:00
Starter Neovim config
Featuring syntax highlighting, file tree sidebar, and fuzzy file finding.
This commit is contained in:
parent
238600bb5b
commit
d8a322f404
3
config/nvim/init.lua
Normal file
3
config/nvim/init.lua
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
require "config.keymaps"
|
||||||
|
require "config.lazy"
|
||||||
|
require "config.options"
|
||||||
@ -1,3 +0,0 @@
|
|||||||
set runtimepath^=~/.vim runtimepath+=~/.vim/after
|
|
||||||
let &packpath = &runtimepath
|
|
||||||
source ~/.vimrc
|
|
||||||
12
config/nvim/lazy-lock.json
Normal file
12
config/nvim/lazy-lock.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "57cce98dfdb2f2dd05a0567d89811e6d0505e13b" },
|
||||||
|
"neo-tree.nvim": { "branch": "v2.x", "commit": "2b2f74828eeb02cf29d6b21aa32eedadadc94ca7" },
|
||||||
|
"nui.nvim": { "branch": "main", "commit": "1f43b13d133eb4b4f53a4485379d9afa58808389" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "411e771d511442ab81670701f5c830f6c74aadd7" },
|
||||||
|
"nvim-treesitter-textobjects": { "branch": "master", "commit": "b55fe6175f0001347a433c9df358c8cbf8a4e90f" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "0568104bf8d0c3ab16395433fcc5c1638efc25d4" },
|
||||||
|
"onedark.nvim": { "branch": "master", "commit": "dd640f6cfb0e370cfd3db389f04b172508848bd3" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" },
|
||||||
|
"telescope.nvim": { "branch": "master", "commit": "942fe5faef47b21241e970551eba407bc10d9547" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "4b73390eec680b4c061ea175eb32c0ff3412271d" }
|
||||||
|
}
|
||||||
18
config/nvim/lua/config/keymaps.lua
Normal file
18
config/nvim/lua/config/keymaps.lua
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
local keymap = vim.keymap.set
|
||||||
|
|
||||||
|
-- Space as leader
|
||||||
|
vim.g.mapleader = ' '
|
||||||
|
|
||||||
|
-- Better pane navigation
|
||||||
|
keymap("n", "<C-h>", "<C-w>h")
|
||||||
|
keymap("n", "<C-j>", "<C-w>j")
|
||||||
|
keymap("n", "<C-k>", "<C-w>k")
|
||||||
|
keymap("n", "<C-l>", "<C-w>l")
|
||||||
|
|
||||||
|
-- Neotree
|
||||||
|
keymap("n", "\\", ":Neotree toggle<CR>")
|
||||||
|
keymap("n", "<C-\\>", ":Neotree reveal<CR>")
|
||||||
|
|
||||||
|
-- Telescope
|
||||||
|
keymap("n", "<C-P>", ":Telescope find_files<CR>")
|
||||||
|
keymap("n", "<C-B>", ":Telescope buffers<CR>")
|
||||||
22
config/nvim/lua/config/lazy.lua
Normal file
22
config/nvim/lua/config/lazy.lua
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
|
||||||
|
if not 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)
|
||||||
|
|
||||||
|
-- Configure lazy.nvim
|
||||||
|
require("lazy").setup("plugins", {
|
||||||
|
install = { missing = true, colorscheme = { "onedark" } },
|
||||||
|
checker = { enabled = true },
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>z", "<cmd>:Lazy<cr>", { desc = "Plugin Manager" })
|
||||||
9
config/nvim/lua/config/options.lua
Normal file
9
config/nvim/lua/config/options.lua
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
require('onedark').load()
|
||||||
|
|
||||||
|
local indent = 2
|
||||||
|
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
vim.opt.shiftwidth = indent
|
||||||
|
vim.opt.smartindent = true
|
||||||
|
vim.opt.tabstop = indent
|
||||||
|
|
||||||
3
config/nvim/lua/plugins/colorschemes.lua
Normal file
3
config/nvim/lua/plugins/colorschemes.lua
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
"navarasu/onedark.nvim"
|
||||||
|
}
|
||||||
2
config/nvim/lua/plugins/init.lua
Normal file
2
config/nvim/lua/plugins/init.lua
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
return {
|
||||||
|
}
|
||||||
9
config/nvim/lua/plugins/neotree.lua
Normal file
9
config/nvim/lua/plugins/neotree.lua
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
|
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
}
|
||||||
|
}
|
||||||
4
config/nvim/lua/plugins/telescope.lua
Normal file
4
config/nvim/lua/plugins/telescope.lua
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" }
|
||||||
|
}
|
||||||
67
config/nvim/lua/plugins/treesitter.lua
Normal file
67
config/nvim/lua/plugins/treesitter.lua
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
build = ":TSUpdate",
|
||||||
|
event = { "BufReadPost", "BufNewFile" },
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||||
|
init = function()
|
||||||
|
-- PERF: no need to load the plugin, if we only need its queries for mini.ai
|
||||||
|
local plugin = require("lazy.core.config").spec.plugins["nvim-treesitter"]
|
||||||
|
local opts = require("lazy.core.plugin").values(plugin, "opts", false)
|
||||||
|
local enabled = false
|
||||||
|
if opts.textobjects then
|
||||||
|
for _, mod in ipairs({ "move", "select", "swap", "lsp_interop" }) do
|
||||||
|
if opts.textobjects[mod] and opts.textobjects[mod].enable then
|
||||||
|
enabled = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not enabled then
|
||||||
|
require("lazy.core.loader").disable_rtp_plugin("nvim-treesitter-textobjects")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
---@type TSConfig
|
||||||
|
opts = {
|
||||||
|
highlight = { enable = true },
|
||||||
|
indent = { enable = true },
|
||||||
|
context_commentstring = { enable = true, enable_autocmd = false },
|
||||||
|
ensure_installed = {
|
||||||
|
"bash",
|
||||||
|
"c",
|
||||||
|
"css",
|
||||||
|
"dockerfile",
|
||||||
|
"eex",
|
||||||
|
"elixir",
|
||||||
|
"help",
|
||||||
|
"html",
|
||||||
|
"javascript",
|
||||||
|
"json",
|
||||||
|
"lua",
|
||||||
|
"luadoc",
|
||||||
|
"luap",
|
||||||
|
"markdown",
|
||||||
|
"markdown_inline",
|
||||||
|
"python",
|
||||||
|
"query",
|
||||||
|
"regex",
|
||||||
|
"ruby",
|
||||||
|
"rust",
|
||||||
|
"scss",
|
||||||
|
"sql",
|
||||||
|
"swift",
|
||||||
|
"toml",
|
||||||
|
"tsx",
|
||||||
|
"typescript",
|
||||||
|
"vim",
|
||||||
|
"vue",
|
||||||
|
"yaml",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
13
config/nvim/lua/plugins/whichkey.lua
Normal file
13
config/nvim/lua/plugins/whichkey.lua
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
return {
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
|
||||||
|
config = function()
|
||||||
|
vim.o.timeout = true
|
||||||
|
vim.o.timeoutlen = 300
|
||||||
|
require("which-key").setup({
|
||||||
|
-- your configuration comes here
|
||||||
|
-- or leave it empty to use the default settings
|
||||||
|
-- refer to the configuration section below
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user