From a8903ac96dd7cd0e1af968d729e557d579f26124 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Fri, 8 Oct 2021 00:09:37 +0300 Subject: neovim: migrate to init.lua --- .config/nvim/lua/settings.lua | 103 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 .config/nvim/lua/settings.lua (limited to '.config/nvim/lua/settings.lua') diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua new file mode 100644 index 0000000..5996c51 --- /dev/null +++ b/.config/nvim/lua/settings.lua @@ -0,0 +1,103 @@ +-- ┌──────────────────┐ +-- │ ▗ │ +-- │▛▀▖▞▀▖▞▀▖▌ ▌▄ ▛▚▀▖│ +-- │▌ ▌▛▀ ▌ ▌▐▐ ▐ ▌▐ ▌│ +-- │▘ ▘▝▀▘▝▀ ▘ ▀▘▘▝ ▘│ +-- └──────────────────┘ +-- ┌───────────────────────┐ +-- │ ▐ ▐ ▗ │ +-- │▞▀▘▞▀▖▜▀ ▜▀ ▄ ▛▀▖▞▀▌▞▀▘│ +-- │▝▀▖▛▀ ▐ ▖▐ ▖▐ ▌ ▌▚▄▌▝▀▖│ +-- │▀▀ ▝▀▘ ▀ ▀ ▀▘▘ ▘▗▄▘▀▀ │ +-- └───────────────────────┘ + +local o = vim.o -- gl[o]bal options +local wo = vim.wo -- [w]indow-local [o]ptions +local bo = vim.bo -- [b]uffer-local [o]ptions +local opt = vim.opt -- convenient :set + +-- look & feel +o.termguicolors = true +vim.cmd('colorscheme rose-pine') + +-- interact with system clipboard +opt.clipboard:append('unnamedplus') + +-- copy indent on a new line +o.autoindent = true + +-- :h tabstop, 2. point +-- use appropriate number of spaces to insert a +o.expandtab = true +o.shiftwidth = 4 +o.softtabstop = 4 +o.tabstop = 8 + +-- use english for spellchecking, but don't spellcheck by default +o.spell = true +o.spelllang = "en_gb" +o.spell = false + +-- tab completion, zsh style +o.wildmode = "full" +opt.wildignore = { + '*.o', '*.obj', '*.class', '*.aux', '*.lof', '*.log', '*.lot', '*.fls', + '*.toc', '*.fmt', '*.fot', '*.cb', '*.cb2', '.*.lb', '.dvi', '*.xdv', + '*.bbl', '*.bcf', '*.blg', '*-blx.aux', '*-blx.bib', '*.run.xml', + '*.fdb_latexmk', '*.synctex', '*.synctex(busy)', '*.synctex.gz', + '*.synctex.gz(busy)', '*.pdfsync' +} + +-- put one space while joining (not two) +o.joinspaces = false + +-- keep n lines above/below cursor while scrolling +o.scrolloff = 4 +-- line numbers +o.number = true +-- fold manually, when I place markers +o.foldmethod = "marker" +-- set the terminal title +o.title = true +-- wrap using 'breakat' character +o.linebreak = true +-- new split panes will split to below and right +o.splitbelow = true +o.splitright = true +-- highlight the current line, yoc undoes +o.cursorline = true +-- current line actual number, rest are relative +o.relativenumber = true +-- we are already using a cursorline, don't clobber linter messages +o.showmode = false +-- jump to the matching bracket briefly +o.showmatch = true +-- move freely between buffers +o.hidden = true + +-- persistent undo +o.undodir = "/home/yigit/.vim/undodir" +o.undofile = true + +-- lower case searches ignore case, upper case searches do not +o.ignorecase = true +o.smartcase = true + +-- https://stackoverflow.com/a/3445040/ +-- switch case labels +o.cinoptions = "l1" + +if vim.fn.executable("rg") then + o.grepprg = "rg --vimgrep --no-heading --smart-case" +end + +-- iwhite: ignore changes in amount of white space. +-- vertical: start diff mode with vertical splits +-- filler: show filler lines, +opt.diffopt = { + "iwhite", "vertical", "filler", "algorithm:patience", "indent-heuristic" +} + +-- menu: use a popup menu to show the possible completions +-- preview: show extra information +opt.completeopt = {"menu", "preview"} -- cgit v1.2.3-70-g09d2