Compare commits
5 commits
f158ecde96
...
d6fbbb945c
Author | SHA1 | Date | |
---|---|---|---|
d6fbbb945c | |||
4c93733c44 | |||
a1fc3d39da | |||
5977d6a7e1 | |||
c5aaacf0f9 |
7 changed files with 74 additions and 44 deletions
|
@ -41,7 +41,11 @@ in
|
||||||
vimdiffAlias = true;
|
vimdiffAlias = true;
|
||||||
withNodeJs = true;
|
withNodeJs = true;
|
||||||
withPython3 = true;
|
withPython3 = true;
|
||||||
extraLuaConfig = builtins.readFile ./init.lua;
|
extraLuaConfig = lib.concatLines (
|
||||||
|
builtins.map
|
||||||
|
builtins.readFile
|
||||||
|
[ ./options.lua ./keybinds.lua ./init.lua ]
|
||||||
|
);
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
alejandra
|
alejandra
|
||||||
black
|
black
|
||||||
|
|
|
@ -1,46 +1,5 @@
|
||||||
vim.g.mapleader = " "
|
|
||||||
vim.g.maplocalleader = ","
|
|
||||||
|
|
||||||
-- FIX to create spell dir if not existent
|
|
||||||
local spelldir = vim.fn.stdpath("data") .. "/site/spell"
|
|
||||||
if not vim.loop.fs_stat(spelldir) then
|
|
||||||
vim.fn.mkdir(spelldir, "p")
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.opt.autoindent = true
|
|
||||||
vim.opt.backupdir = { vim.fn.stdpath("state") .. "/nvim/backup/" } -- don't store backup in files dir
|
|
||||||
vim.opt.clipboard = "unnamedplus" -- sync with system clipboard
|
|
||||||
vim.opt.conceallevel = 2
|
|
||||||
vim.opt.expandtab = true -- spaces instead of tabs
|
|
||||||
vim.opt.ignorecase = true
|
|
||||||
vim.opt.mouse = "a" -- mouse for all modes
|
|
||||||
vim.opt.number = true
|
|
||||||
vim.opt.relativenumber = true
|
|
||||||
vim.opt.scrolloff = 4 -- lines of context
|
|
||||||
vim.opt.shiftround = true -- round indent
|
|
||||||
vim.opt.shiftwidth = 0 -- use tabstop value
|
|
||||||
vim.opt.shortmess:append({ c = true })
|
|
||||||
vim.opt.signcolumn = "yes"
|
|
||||||
vim.opt.smartcase = true
|
|
||||||
vim.opt.splitbelow = true
|
|
||||||
vim.opt.splitright = true
|
|
||||||
vim.opt.tabstop = 2
|
|
||||||
vim.opt.termguicolors = true
|
|
||||||
vim.opt.undofile = true
|
|
||||||
vim.opt.undolevels = 10000
|
|
||||||
vim.opt.updatetime = 300
|
|
||||||
vim.opt_local.spell = true
|
|
||||||
vim.opt_local.spelllang = { "en", "de_20" } -- all English regions and new German spelling
|
|
||||||
|
|
||||||
if vim.g.neovide then
|
|
||||||
vim.opt.guifont = "Fira Code Nerd Font:h10"
|
|
||||||
vim.g.neovide_scale_factor = 0.7
|
|
||||||
end
|
|
||||||
|
|
||||||
require("impatient")
|
require("impatient")
|
||||||
|
|
||||||
local wk = require("which-key")
|
|
||||||
|
|
||||||
require("nvim-treesitter.configs").setup({
|
require("nvim-treesitter.configs").setup({
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
auto_install = false,
|
auto_install = false,
|
||||||
|
@ -181,7 +140,7 @@ vim.o.statuscolumn = "%= "
|
||||||
.. "%= " -- spacing between end of column and start of text
|
.. "%= " -- spacing between end of column and start of text
|
||||||
|
|
||||||
-- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
|
-- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
|
||||||
wk.register({
|
require("which-key").register({
|
||||||
z = {
|
z = {
|
||||||
R = { require("ufo").openAllFolds, "Open all folds" },
|
R = { require("ufo").openAllFolds, "Open all folds" },
|
||||||
M = { require("ufo").closeAllFolds, "Close all folds" },
|
M = { require("ufo").closeAllFolds, "Close all folds" },
|
||||||
|
@ -210,7 +169,7 @@ require("lspsaga").setup({
|
||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
local on_attach_def = function(_, bufnr)
|
local on_attach_def = function(_, bufnr)
|
||||||
wk.register({
|
require("which-key").register({
|
||||||
K = { "<cmd>Lspsaga hover_doc ++quiet<cr>", "show info" },
|
K = { "<cmd>Lspsaga hover_doc ++quiet<cr>", "show info" },
|
||||||
["<leader>"] = {
|
["<leader>"] = {
|
||||||
l = {
|
l = {
|
||||||
|
|
21
modules/programs/nvim/keybinds.lua
Normal file
21
modules/programs/nvim/keybinds.lua
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
-- buffers
|
||||||
|
require("which-key").register({
|
||||||
|
b = {
|
||||||
|
name = "buffers",
|
||||||
|
b = { "<cmd>Telescope buffers<cr>", "List buffers" },
|
||||||
|
d = { "<cmd>bd<cr>", "Delete buffer" },
|
||||||
|
n = { "<cmd>bnext<cr>", "Next buffer" },
|
||||||
|
p = { "<cmd>bprevious<cr>", "Previous buffer" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Clear search with <esc>
|
||||||
|
require("which-key").register({
|
||||||
|
["<esc>"] = { "<cmd>noh<cr><esc>", "Escape and clear hlsearch", mode = { "n", "i" } },
|
||||||
|
})
|
||||||
|
|
||||||
|
-- better indenting
|
||||||
|
require("which-key").register({
|
||||||
|
["<"] = { "<gv", "Shift left" },
|
||||||
|
[">"] = { ">gv", "Shift right" },
|
||||||
|
}, { mode = "v" })
|
38
modules/programs/nvim/options.lua
Normal file
38
modules/programs/nvim/options.lua
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = ","
|
||||||
|
|
||||||
|
-- FIX to create spell dir if not existent
|
||||||
|
local spelldir = vim.fn.stdpath("data") .. "/site/spell"
|
||||||
|
if not vim.loop.fs_stat(spelldir) then
|
||||||
|
vim.fn.mkdir(spelldir, "p")
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.opt.autoindent = true
|
||||||
|
vim.opt.backupdir = { vim.fn.stdpath("state") .. "/nvim/backup/" } -- don't store backup in files dir
|
||||||
|
vim.opt.clipboard = "unnamedplus" -- sync with system clipboard
|
||||||
|
vim.opt.conceallevel = 2
|
||||||
|
vim.opt.expandtab = true -- spaces instead of tabs
|
||||||
|
vim.opt.ignorecase = true
|
||||||
|
vim.opt.mouse = "a" -- mouse for all modes
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
vim.opt.scrolloff = 4 -- lines of context
|
||||||
|
vim.opt.shiftround = true -- round indent
|
||||||
|
vim.opt.shiftwidth = 0 -- use tabstop value
|
||||||
|
vim.opt.shortmess:append({ c = true })
|
||||||
|
vim.opt.signcolumn = "yes"
|
||||||
|
vim.opt.smartcase = true
|
||||||
|
vim.opt.splitbelow = true
|
||||||
|
vim.opt.splitright = true
|
||||||
|
vim.opt.tabstop = 2
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
vim.opt.undofile = true
|
||||||
|
vim.opt.undolevels = 10000
|
||||||
|
vim.opt.updatetime = 300
|
||||||
|
vim.opt_local.spell = true
|
||||||
|
vim.opt_local.spelllang = { "en", "de_20" } -- all English regions and new German spelling
|
||||||
|
|
||||||
|
if vim.g.neovide then
|
||||||
|
vim.opt.guifont = "Fira Code Nerd Font:h10"
|
||||||
|
vim.g.neovide_scale_factor = 0.7
|
||||||
|
end
|
2
modules/programs/nvim/plugins/bufferline-nvim.lua
Normal file
2
modules/programs/nvim/plugins/bufferline-nvim.lua
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
require("bufferline").setup()
|
|
@ -1 +1,6 @@
|
||||||
require("nvim-autopairs").setup()
|
require("nvim-autopairs").setup()
|
||||||
|
|
||||||
|
-- If you want insert `(` after select function or method item
|
||||||
|
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||||
|
local cmp = require("cmp")
|
||||||
|
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||||
|
|
1
modules/programs/nvim/plugins/oil-nvim.lua
Normal file
1
modules/programs/nvim/plugins/oil-nvim.lua
Normal file
|
@ -0,0 +1 @@
|
||||||
|
require("oil").setup()
|
Loading…
Reference in a new issue