mirror of
https://github.com/kossLAN/nvim-flake.git
synced 2025-11-05 02:09:49 -05:00
Initial Commit
This commit is contained in:
commit
fd4cc7c8e6
31 changed files with 2687 additions and 0 deletions
105
nvim/init.lua
Normal file
105
nvim/init.lua
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
local cmd = vim.cmd
|
||||
local fn = vim.fn
|
||||
local opt = vim.o
|
||||
local g = vim.g
|
||||
|
||||
-- <leader> key. Defaults to `\`. Some people prefer space.
|
||||
g.mapleader = ' '
|
||||
g.maplocalleader = ' '
|
||||
|
||||
opt.compatible = false
|
||||
|
||||
-- Enable true colour support
|
||||
if fn.has('termguicolors') then
|
||||
opt.termguicolors = true
|
||||
end
|
||||
|
||||
-- See :h <option> to see what the options do
|
||||
|
||||
-- Search down into subfolders
|
||||
opt.path = vim.o.path .. '**'
|
||||
|
||||
opt.number = true
|
||||
opt.relativenumber = false
|
||||
opt.cursorline = true
|
||||
opt.lazyredraw = true
|
||||
opt.showmatch = true -- Highlight matching parentheses, etc
|
||||
opt.incsearch = true
|
||||
opt.hlsearch = true
|
||||
|
||||
opt.spell = true
|
||||
opt.spelllang = 'en'
|
||||
|
||||
opt.expandtab = true
|
||||
opt.tabstop = 2
|
||||
opt.softtabstop = 2
|
||||
opt.shiftwidth = 2
|
||||
opt.foldenable = true
|
||||
opt.history = 2000
|
||||
opt.nrformats = 'bin,hex' -- 'octal'
|
||||
opt.undofile = true
|
||||
opt.splitright = true
|
||||
opt.splitbelow = true
|
||||
opt.cmdheight = 0
|
||||
|
||||
opt.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
|
||||
|
||||
-- Configure Neovim diagnostic messages
|
||||
|
||||
local function prefix_diagnostic(prefix, diagnostic)
|
||||
return string.format(prefix .. ' %s', diagnostic.message)
|
||||
end
|
||||
|
||||
vim.diagnostic.config {
|
||||
virtual_text = {
|
||||
prefix = '',
|
||||
format = function(diagnostic)
|
||||
local severity = diagnostic.severity
|
||||
if severity == vim.diagnostic.severity.ERROR then
|
||||
return prefix_diagnostic('', diagnostic)
|
||||
end
|
||||
if severity == vim.diagnostic.severity.WARN then
|
||||
return prefix_diagnostic('⚠', diagnostic)
|
||||
end
|
||||
if severity == vim.diagnostic.severity.INFO then
|
||||
return prefix_diagnostic('ⓘ', diagnostic)
|
||||
end
|
||||
if severity == vim.diagnostic.severity.HINT then
|
||||
return prefix_diagnostic('', diagnostic)
|
||||
end
|
||||
return prefix_diagnostic('■', diagnostic)
|
||||
end,
|
||||
},
|
||||
signs = {
|
||||
text = {
|
||||
-- Requires Nerd fonts
|
||||
[vim.diagnostic.severity.ERROR] = '',
|
||||
[vim.diagnostic.severity.WARN] = '⚠',
|
||||
[vim.diagnostic.severity.INFO] = 'ⓘ',
|
||||
[vim.diagnostic.severity.HINT] = '',
|
||||
},
|
||||
},
|
||||
update_in_insert = false,
|
||||
underline = true,
|
||||
severity_sort = true,
|
||||
float = {
|
||||
focusable = false,
|
||||
style = 'minimal',
|
||||
border = 'rounded',
|
||||
source = 'if_many',
|
||||
header = '',
|
||||
prefix = '',
|
||||
},
|
||||
}
|
||||
|
||||
g.editorconfig = true
|
||||
|
||||
-- Native plugins
|
||||
cmd.filetype('plugin', 'indent', 'on')
|
||||
cmd.packadd('cfilter') -- Allows filtering the quickfix list with :cfdo
|
||||
|
||||
-- let sqlite.lua (which some plugins depend on) know where to find sqlite
|
||||
vim.g.sqlite_clib_path = require('luv').os_getenv('LIBSQLITE')
|
||||
|
||||
-- Vim Theme
|
||||
vim.cmd.colorscheme 'tokyonight-night'
|
||||
Loading…
Add table
Add a link
Reference in a new issue