refactor(nvim): move options to seperate file

nixos
Moritz Böhme 2023-03-26 18:27:41 +02:00
parent f158ecde96
commit c5aaacf0f9
Signed by: moritz
GPG Key ID: 970C6E89EB0547A9
3 changed files with 43 additions and 40 deletions

View File

@ -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 ./init.lua ]
);
extraPackages = with pkgs; [ extraPackages = with pkgs; [
alejandra alejandra
black black

View File

@ -1,42 +1,3 @@
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") local wk = require("which-key")

View 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