add first working draft
This commit is contained in:
commit
c591c88f43
13 changed files with 179 additions and 0 deletions
14
init.lua
Normal file
14
init.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
--[[
|
||||
My simple Neovim configuration. Made from scratch, inspired by
|
||||
https://www.youtube.com/watch?v=w7i4amO_zaE
|
||||
|
||||
EXTERNAL DEPENDENCIES:
|
||||
- ripgrep (https://github.com/BurntSushi/ripgrep, used by telescope)
|
||||
- fd (https://github.com/sharkdp/fd, used by telescope)
|
||||
|
||||
CHANGELOG:
|
||||
- 2023-11-20: init, lazy, fuzzy, remaps
|
||||
--]]
|
||||
|
||||
-- leader key must be defined before lazy.nvim)
|
||||
require("weeheavy")
|
||||
12
lazy-lock.json
Normal file
12
lazy-lock.json
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
|
||||
"nightfox.nvim": { "branch": "main", "commit": "6a6076bd678f825ffbe16ec97807793c3167f1a7" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "3da5cfb4a2505bc10d6fe3c193c69adac13423a8" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "ec7f160375226d90f16a019d175be730e4ac456b" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "dbcd9388e3b119a87c785e10a00d62876077d23d" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "cdbcca210cf3655aa9b31ebf2422763ecd85ee5c" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
|
||||
}
|
||||
11
lua/weeheavy/init.lua
Normal file
11
lua/weeheavy/init.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
-- debug
|
||||
--print("weeheavy module imported")
|
||||
|
||||
-- init custom keybindings
|
||||
require("weeheavy.remap")
|
||||
|
||||
-- Install and configure Lazy package manager
|
||||
require("weeheavy.lazy")
|
||||
|
||||
-- Other preferences
|
||||
require("weeheavy.prefs")
|
||||
16
lua/weeheavy/lazy.lua
Normal file
16
lua/weeheavy/lazy.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
-- Lazy package manager
|
||||
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)
|
||||
|
||||
--require("lazy").setup({ { import = "weeheavy.plugins" }, { import = "weeheavy.plugins.lsp" } })
|
||||
require("lazy").setup({ { import = "weeheavy.plugins" } })
|
||||
4
lua/weeheavy/plugins/devicons.lua
Normal file
4
lua/weeheavy/plugins/devicons.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
lazy = true
|
||||
}
|
||||
7
lua/weeheavy/plugins/nightfox.lua
Normal file
7
lua/weeheavy/plugins/nightfox.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
'EdenEast/nightfox.nvim',
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd.colorscheme 'duskfox'
|
||||
end,
|
||||
}
|
||||
3
lua/weeheavy/plugins/sleuth.lua
Normal file
3
lua/weeheavy/plugins/sleuth.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"tpope/vim-sleuth"
|
||||
}
|
||||
4
lua/weeheavy/plugins/telescope.lua
Normal file
4
lua/weeheavy/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
"nvim-telescope/telescope.nvim", tag = "0.1.4",
|
||||
dependencies = { "nvim-lua/plenary.nvim" }
|
||||
}
|
||||
5
lua/weeheavy/plugins/treesitter-context.lua
Normal file
5
lua/weeheavy/plugins/treesitter-context.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
-- Shows context of code line
|
||||
-- Docs: https://github.com/nvim-treesitter/nvim-treesitter-context
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter-context"
|
||||
}
|
||||
45
lua/weeheavy/plugins/treesitter.lua
Normal file
45
lua/weeheavy/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
},
|
||||
config = function()
|
||||
local treesitter = require("nvim-treesitter.configs")
|
||||
|
||||
treesitter.setup({
|
||||
highlight = { enable = true, },
|
||||
indent = { enable = true },
|
||||
auto_install = false,
|
||||
-- language list: https://github.com/nvim-treesitter/nvim-treesitter#supported-languages
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"bash",
|
||||
"diff",
|
||||
"gitignore",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"elixir",
|
||||
"eex",
|
||||
"heex",
|
||||
"yaml",
|
||||
"html",
|
||||
"css",
|
||||
"dockerfile",
|
||||
"query",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
24
lua/weeheavy/plugins/which-key.lua
Normal file
24
lua/weeheavy/plugins/which-key.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 100
|
||||
end,
|
||||
opts = {
|
||||
layout = {
|
||||
height = { min = 4, max = 25 }, -- min and max height of the columns
|
||||
width = { min = 20, max = 50 }, -- min and max width of the columns
|
||||
spacing = 3, -- spacing between columns
|
||||
align = "left", -- align columns left, center or right
|
||||
},
|
||||
window = {
|
||||
border = "none", -- none, single, double, shadow
|
||||
position = "bottom", -- bottom, top
|
||||
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]. When between 0 and 1, will be treated as a percentage of the screen size.
|
||||
padding = { 1, 2, 1, 2 }, -- extra window padding [top, right, bottom, left]
|
||||
winblend = 1, -- value between 0-100 0 for fully opaque and 100 for fully transparent
|
||||
zindex = 1000, -- positive value to position WhichKey above other floating windows.
|
||||
},
|
||||
}
|
||||
}
|
||||
24
lua/weeheavy/prefs.lua
Normal file
24
lua/weeheavy/prefs.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
-- Preferences
|
||||
|
||||
-- Set highlight on search
|
||||
vim.o.hlsearch = true
|
||||
|
||||
-- Make line numbers default
|
||||
--vim.wo.number = true
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.signcolumn = "number"
|
||||
|
||||
-- Dynamic line numbers
|
||||
--vim.wo.relativenumber = true
|
||||
|
||||
-- highlight columns
|
||||
vim.o.colorcolumn= '80,120'
|
||||
|
||||
-- Sync clipboard between OS and Neovim.
|
||||
-- Remove this option if you want your OS clipboard to remain independent.
|
||||
-- See `:help 'clipboard'`
|
||||
vim.o.clipboard = 'unnamedplus'
|
||||
|
||||
-- Always keep this amount of lines above and below the cursor
|
||||
vim.opt.scrolloff = 5
|
||||
10
lua/weeheavy/remap.lua
Normal file
10
lua/weeheavy/remap.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
-- keyboard shortcuts
|
||||
|
||||
-- Leader key set to space, base for any key combo
|
||||
vim.g.mapleader = " "
|
||||
|
||||
vim.keymap.set("n", "<leader>r", vim.cmd.Ex, { noremap = true, desc = "netrw File Browser" }) -- netrw file explorer
|
||||
|
||||
-- Telescope
|
||||
vim.keymap.set("n", "<leader>e", ":Telescope file_browser<CR>", { noremap = true, desc = "Telescope Browser" })
|
||||
vim.keymap.set("n", "<leader>f", ":Telescope find_files<CR>", { noremap = true, desc = "Telescope File Search" })
|
||||
Loading…
Add table
Add a link
Reference in a new issue