add config files, script to copy them to the repo and update readme
This commit is contained in:
14
.config/nvim/init.lua
Normal file
14
.config/nvim/init.lua
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
vim.o.mouse = "a"
|
||||||
|
vim.o.selection="exclusive"
|
||||||
|
vim.o.selectmode="mouse,key"
|
||||||
|
vim.o.keymodel="startsel,stopsel"
|
||||||
|
|
||||||
|
-- Configs
|
||||||
|
require("config.lazy")
|
||||||
|
-- Plugins
|
||||||
|
require("plugins.colorscheme")
|
||||||
|
require("plugins.nvim-web-devicons")
|
||||||
|
require("plugins.nvim-tree")
|
||||||
|
require("plugins.fzf-lua")
|
||||||
|
require("plugins.lualine")
|
||||||
|
|
||||||
36
.config/nvim/lua/config/lazy.lua
Normal file
36
.config/nvim/lua/config/lazy.lua
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
-- Bootstrap lazy.nvim
|
||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
|
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||||
|
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||||
|
if vim.v.shell_error ~= 0 then
|
||||||
|
vim.api.nvim_echo({
|
||||||
|
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||||
|
{ out, "WarningMsg" },
|
||||||
|
{ "\nPress any key to exit..." },
|
||||||
|
}, true, {})
|
||||||
|
vim.fn.getchar()
|
||||||
|
os.exit(1)
|
||||||
|
end
|
||||||
|
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 = { } },
|
||||||
|
-- automatically check for plugin updates
|
||||||
|
checker = { enabled = false },
|
||||||
|
})
|
||||||
|
|
||||||
4
.config/nvim/lua/plugins/coc.lua
Normal file
4
.config/nvim/lua/plugins/coc.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
"neoclide/coc.nvim",
|
||||||
|
branch = "release",
|
||||||
|
}
|
||||||
12
.config/nvim/lua/plugins/colorscheme.lua
Normal file
12
.config/nvim/lua/plugins/colorscheme.lua
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
return {
|
||||||
|
"navarasu/onedark.nvim",
|
||||||
|
priority = 1000, -- make sure to load this before all the other start plugins
|
||||||
|
config = function()
|
||||||
|
require('onedark').setup {
|
||||||
|
style = 'cool'
|
||||||
|
}
|
||||||
|
-- Enable theme
|
||||||
|
require('onedark').load()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
16
.config/nvim/lua/plugins/fzf-lua.lua
Normal file
16
.config/nvim/lua/plugins/fzf-lua.lua
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
return {
|
||||||
|
"ibhagwan/fzf-lua",
|
||||||
|
-- optional for icon support
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
-- or if using mini.icons/mini.nvim
|
||||||
|
-- dependencies = { "echasnovski/mini.icons" },
|
||||||
|
opts = {},
|
||||||
|
config = function()
|
||||||
|
require("fzf-lua").setup({
|
||||||
|
fzf_bin = "sk",
|
||||||
|
grep = {
|
||||||
|
glob_flag = "--glob",
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
16
.config/nvim/lua/plugins/lualine.lua
Normal file
16
.config/nvim/lua/plugins/lualine.lua
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
return {
|
||||||
|
'nvim-lualine/lualine.nvim',
|
||||||
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||||
|
config = function()
|
||||||
|
require("lualine").setup({
|
||||||
|
sections = {
|
||||||
|
lualine_a = { "mode" },
|
||||||
|
lualine_b = { "branch", "diff", "diagnostics" },
|
||||||
|
lualine_c = { "filename" },
|
||||||
|
lualine_x = { "encoding", "fileformat", "filetype" },
|
||||||
|
lualine_y = { "progress" },
|
||||||
|
lualine_z = { "location" },
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
14
.config/nvim/lua/plugins/nvim-tree.lua
Normal file
14
.config/nvim/lua/plugins/nvim-tree.lua
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
return {
|
||||||
|
"nvim-tree/nvim-tree.lua",
|
||||||
|
version = "1.14.0",
|
||||||
|
lazy = false,
|
||||||
|
dependencies = {
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
require("nvim-tree").setup {}
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
5
.config/nvim/lua/plugins/nvim-web-devicons.lua
Normal file
5
.config/nvim/lua/plugins/nvim-web-devicons.lua
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
opts = {}
|
||||||
|
}
|
||||||
|
|
||||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.config/nvim/lazy-lock.json
|
||||||
|
|
||||||
29
README.md
29
README.md
@@ -0,0 +1,29 @@
|
|||||||
|
# My personal Neovim configs
|
||||||
|
I usually don't make my configs public, but I'm making an exception for this one just for convenience and portability. Feel free to fork this or do whatever.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
- `fzf`
|
||||||
|
- Required by `fzf-lua`. It can be installed with your OS' package manager. If the `fzf` version is too old or you can't install it for some reason, you can try `skim`, which can be installed with `cargo install skim`. Type `sk` in your terminal to make sure it is installed.
|
||||||
|
- `ripgrep`
|
||||||
|
- Also required by `fzf-lua`. Although it is technically optional. Just like `fzf`, it can either be installed with the package manager of your choice or with `cargo install ripgrep`.
|
||||||
|
- Nerd Fonts
|
||||||
|
- Required by `nvim-web-devicons`. You can download them from nerdfonts.com. Place them in the `~/.fonts` folder, run `fc-cache -fv`, and configure your terminal emulator to use the font that you downloaded. I personally picked "NotoSansM NerdFontMono".
|
||||||
|
- Node.js
|
||||||
|
- required by CoC. You can install it with this command: `curl -sL install-node.vercel.app/lts | bash`.
|
||||||
|
- `rust-analyzer`
|
||||||
|
- Very optional but I do a lot of coding in Rust. You can install `rust-analyzer` with `rustup component add rust-analyzer`. Make sure to also run `:CocInstall coc-rust-analyzer` from Neovim.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
Run `./sync-config.sh` to copy the current configs to this repo. Eventually I will have another `./install.sh` script to do everything automatically.
|
||||||
|
|
||||||
|
|
||||||
|
## FAQ
|
||||||
|
(although nobody has actually asked anything yet but whatever)
|
||||||
|
|
||||||
|
- Q: Lmao why didn't just use a tool to manage dotfiles
|
||||||
|
A: I wanted to have an individual repo just for neovim stuff, along with a shell script to set everything up. I may create another repo some day with other dotfiles for the rest of my system though.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
0
sync-config.sh
Normal file
0
sync-config.sh
Normal file
Reference in New Issue
Block a user