aboutsummaryrefslogtreecommitdiffstats
path: root/home/nvim
diff options
context:
space:
mode:
authorPetri Hienonen <petri.hienonen@gmail.com>2026-01-12 10:17:28 +0200
committerPetri Hienonen <petri.hienonen@gmail.com>2026-01-12 10:17:28 +0200
commit9091ec72fe5ed12ae56a46f8580e0053d4b525fb (patch)
treeaf7c1d6a472b8ec6a3060bd53cb2ffdb6b9221e3 /home/nvim
parentb85d671f4977ee7b3a5a7f079d618c5449f86940 (diff)
downloadnixos-9091ec72fe5ed12ae56a46f8580e0053d4b525fb.tar.zst
Minor nvim changes
Diffstat (limited to '')
-rw-r--r--home/nvim/lsp.lua11
-rw-r--r--home/nvim/options.lua84
-rw-r--r--home/nvim/plugins/treesitter.lua12
3 files changed, 57 insertions, 50 deletions
diff --git a/home/nvim/lsp.lua b/home/nvim/lsp.lua
index 5371eb2..97037c6 100644
--- a/home/nvim/lsp.lua
+++ b/home/nvim/lsp.lua
@@ -120,19 +120,22 @@ vim.lsp.config("lua_ls", {
cmd = { "lua-language-server" },
filetypes = { "lua" },
root_markers = { ".luarc.json", ".luarc.jsonc" },
+ single_file_support = true,
settings = {
Lua = {
format = {
enable = true,
defaultConfig = {
- indent_style = "tab",
indent_size = 1,
- quote_style = "double",
- max_line_length = 120
+ indent_style = "tab",
+ max_line_length = 120,
+ quote_style = "double"
},
},
runtime = { version = "LuaJIT" },
- diagnostics = { globals = { "vim", "luassert" }, enable = true },
+ diagnostics = {
+ globals = { "vim", "luassert", "luv" },
+ },
workspace = {
checkThirdParty = true,
library = vim.api.nvim_get_runtime_file("", true),
diff --git a/home/nvim/options.lua b/home/nvim/options.lua
index 9911824..109c9b5 100644
--- a/home/nvim/options.lua
+++ b/home/nvim/options.lua
@@ -1,89 +1,93 @@
-vim.opt.title = true -- set the title of window to the value of the titlestring
-vim.opt.titlestring = "%<%F%=%l/%L - nvim" -- what the title of the window will be set to
+vim.schedule(function()
+ vim.opt.clipboard = "unnamedplus"
+end)
+
vim.g.have_nerd_fonts = true
-vim.o.shell = "nushell"
+
vim.o.fileencoding = "utf-8"
+vim.o.mouse = "a" -- turn on mouse interaction
+vim.o.shell = "nushell"
+vim.o.signcolumn = true
+vim.o.termguicolors = true -- Enable GUI colors for the terminal to get truecolor
vim.opt.conceallevel = 0
-vim.opt.clipboard:append("unnamedplus") -- copy & paste
-vim.o.termguicolors = true -- Enable GUI colors for the terminal to get truecolor
-vim.o.mouse = "a" -- turn on mouse interaction
-vim.o.signcolumn = "yes"
+vim.opt.title = true -- set the title of window to the value of the titlestring
+vim.opt.titlestring = "%<%F%=%l/%L - nvim" -- what the title of the window will be set to
vim.o.guicursor = table.concat({
"n-v-c:block-Cursor/lCursor-blinkwait1000-blinkon100-blinkoff100",
"i-ci:ver25-Cursor/lCursor-blinkwait1000-blinkon100-blinkoff100",
"r:hor50-Cursor/lCursor-blinkwait100-blinkon100-blinkoff100",
}, ",")
-vim.opt.completeopt = { "menu", "menuone", "noselect", "noinsert", "preview" } -- completion options
-vim.opt.shortmess:append("c")
-vim.o.updatetime = 100 -- CursorHold interval
-vim.opt.wrap = true
-vim.opt.linebreak = true
-vim.opt.breakindent = true
-vim.opt.inccommand = "split"
-vim.opt.virtualedit = "block"
-vim.opt.grepprg = "rg --vimgrep"
-vim.opt.grepformat = "%f:%l:%c:%m"
-vim.o.textwidth = 100
-vim.o.tabstop = 4
-vim.o.softtabstop = 4
+vim.o.autoindent = true
+vim.o.expandtab = false
+vim.o.list = true -- show hidden characters by default
vim.o.shiftwidth = 4
-vim.o.expandtab = true
-vim.o.smartindent = true
-vim.opt.smartcase = true
vim.o.shiftwidth = 4
-vim.o.autoindent = true
+vim.o.smartindent = true
vim.o.smarttab = true -- <tab>/<BS> indent/dedent in leading whitespace
-vim.o.list = true -- show hidden characters by default
+vim.o.softtabstop = 4
+vim.o.tabstop = 4
+vim.o.textwidth = 100
+vim.o.updatetime = 100 -- CursorHold interval
+vim.opt.breakindent = true
+vim.opt.completeopt = { "menu", "menuone", "noselect", "noinsert", "preview" } -- completion options
+vim.opt.grepformat = "%f:%l:%c:%m"
+vim.opt.grepprg = "rg --vimgrep"
vim.opt.hidden = true -- required to keep multiple buffers and open multiple buffers
+vim.opt.inccommand = "split"
+vim.opt.linebreak = true
+vim.opt.shortmess:append("c")
+vim.opt.smartcase = true
+vim.opt.virtualedit = "block"
+vim.opt.wrap = true
vim.o.undofile = true
vim.o.undodir = "/home/petri/.config/nvim/undo/"
vim.o.backupdir = "/home/petri/.config/nvim/backup/"
vim.o.directory = "/home/petri/.config/nvim//swp/"
-vim.o.number = true -- show line numbers
-vim.o.showmode = false -- we are already showing mode
-vim.o.relativenumber = true -- relative line numbers
-vim.o.hlsearch = true -- highlighted search results
-vim.o.incsearch = true -- incremental search
-vim.o.ignorecase = true -- ignore case sensetive while searching
vim.o.colorcolumn = "100"
vim.o.cursorline = true -- highlight current line
-vim.opt.showmatch = true -- show matching bracket
+vim.o.hlsearch = true -- highlighted search results
+vim.o.ignorecase = true -- ignore case sensetive while searching
+vim.o.incsearch = true -- incremental search
+vim.o.number = true -- show line numbers
+vim.o.relativenumber = true -- relative line numbers
+vim.o.showmode = false -- we are already showing mode
vim.opt.matchtime = 2 -- how long to show matching bracket
vim.opt.pumblend = 10 -- popup menu transparency
+vim.opt.showmatch = true -- show matching bracket
+vim.opt.synmaxcol = 300
vim.opt.winblend = 0
vim.opt.winborder = "rounded"
-vim.opt.synmaxcol = 300
-vim.opt.swapfile = false
vim.opt.autoread = true
vim.opt.path:append("**") -- include subdirectories in search
vim.opt.selection = "exclusive" -- Selection behavior
vim.opt.showtabline = 2 -- show when multiple open
+vim.opt.swapfile = false
-vim.opt.foldmethod = "syntax"
-vim.opt.foldlevel = 99 -- Start with all folds open
vim.opt.foldenable = true -- Enable folding
+vim.opt.foldlevel = 99 -- Start with all folds open
+vim.opt.foldmethod = "syntax"
vim.opt.scrolloff = 8
vim.opt.sidescrolloff = 8
+vim.opt.backspace = "indent,start,eol" -- make backspace behave like normal again
vim.opt.formatoptions:remove({ "c", "t" })
+vim.opt.laststatus = 2 -- always show status line
+vim.opt.lazyredraw = false -- faster scrolling
vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" }
-vim.opt.backspace = "indent,start,eol" -- make backspace behave like normal again
vim.opt.splitbelow = true -- open horizontal splits below current window
vim.opt.splitright = true -- open vertical splits to the right of the current window
-vim.opt.laststatus = 2 -- always show status line
vim.opt.wildignore = vim.opt.wildignore + "*.o,*.rej,*.so" -- patterns to ignore during file-navigation
-vim.opt.lazyredraw = false -- faster scrolling
vim.opt.spell = false
vim.opt.spelllang = "en"
+vim.opt.wildignore:append({ "*.pyc" })
vim.opt.wildmenu = true
vim.opt.wildmode = "longest:full,full"
-vim.opt.wildignore:append({ "*.pyc" })
vim.opt.diffopt:append("linematch:60")
diff --git a/home/nvim/plugins/treesitter.lua b/home/nvim/plugins/treesitter.lua
index fcc0048..314e4a3 100644
--- a/home/nvim/plugins/treesitter.lua
+++ b/home/nvim/plugins/treesitter.lua
@@ -1,30 +1,30 @@
local function disable(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
- local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
+ local ok, stats = pcall(vim.uv.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end
require("nvim-treesitter").setup({
+ auto_install = false,
ensure_installed = {},
- sync_install = false,
ignore_install = {},
modules = {},
- auto_install = false,
+ sync_install = false,
highlight = {
- enable = true,
- disable = disable,
additional_vim_regex_highlighting = false,
+ disable = disable,
+ enable = true,
},
indent = { enable = true, disable = { "rust", "lua", "python", "golang", "nix", "json", "html", "javascript" } },
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<leader>vv",
+ node_decremental = "_",
node_incremental = "+",
scope_incremental = false,
- node_decremental = "_",
},
},
textobjects = {