2023-02-10 15:15:13 -05:00
|
|
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
|
|
|
|
if not vim.loop.fs_stat(lazypath) then
|
|
|
|
|
vim.fn.system({
|
|
|
|
|
"git",
|
|
|
|
|
"clone",
|
|
|
|
|
"--filter=blob:none",
|
|
|
|
|
"https://github.com/folke/lazy.nvim.git",
|
|
|
|
|
"--branch=stable", -- latest stable release
|
|
|
|
|
lazypath,
|
|
|
|
|
})
|
|
|
|
|
end
|
|
|
|
|
vim.opt.rtp:prepend(lazypath)
|
|
|
|
|
|
|
|
|
|
vim.g.mapleader = ','
|
|
|
|
|
vim.g.localmapleader = ','
|
|
|
|
|
|
|
|
|
|
require('lazy').setup('plugins')
|
2022-03-03 13:52:43 -05:00
|
|
|
require('keymaps')
|
2023-02-10 15:15:13 -05:00
|
|
|
|
|
|
|
|
-- General Neovim settings and configuration
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
-- Neovim API aliases
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
local fn = vim.fn -- Call Vim functions
|
|
|
|
|
local cmd = vim.cmd -- Execute Vim commands
|
|
|
|
|
local exec = vim.api.nvim_exec -- Execute Vimscript
|
|
|
|
|
local g = vim.g -- Global variables
|
|
|
|
|
local opt = vim.opt -- Set options (global/buffer/windows-scoped)
|
|
|
|
|
local o = vim.o
|
|
|
|
|
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
-- General
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
g.mapleader = ',' -- Change leader to a comma
|
|
|
|
|
opt.mouse = 'a' -- Enable mouse support
|
|
|
|
|
opt.clipboard = 'unnamedplus' -- Copy/paste to system clipboard
|
|
|
|
|
opt.swapfile = false -- Don't use swapfile
|
|
|
|
|
opt.shadafile = "NONE"
|
|
|
|
|
opt.shadafile = ""
|
|
|
|
|
opt.shell = "/bin/zsh"
|
|
|
|
|
opt.updatetime = 200
|
|
|
|
|
opt.cursorline = true
|
|
|
|
|
g.markdown_folding = 1
|
|
|
|
|
opt.spell=true
|
|
|
|
|
opt.spelllang = 'en_us'
|
|
|
|
|
cmd [[ autocmd BufWritePre * :%s/\s\+$//e ]]
|
|
|
|
|
vim.api.nvim_set_hl(0, "ColorColumn", {guibg=lightmagenta})
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
-- Neovim UI
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
opt.number = true -- Show line number
|
|
|
|
|
opt.relativenumber = true -- Show Current Line with Relative numbers above and below cursor.
|
|
|
|
|
opt.showmatch = true -- Highlight matching parenthesis
|
|
|
|
|
opt.foldmethod = 'syntax' -- Enable folding (default 'foldmarker')
|
|
|
|
|
opt.colorcolumn = '120' -- Line length marker at 80 columns
|
|
|
|
|
opt.textwidth = 120
|
|
|
|
|
opt.splitright = true -- Vertical split to the right
|
|
|
|
|
opt.splitbelow = true -- Horizontal split to the bottom
|
|
|
|
|
opt.ignorecase = true -- Ignore case letters when search
|
|
|
|
|
opt.smartcase = true -- Ignore lowercase for the whole pattern
|
|
|
|
|
opt.linebreak = true -- Wrap on word boundary
|
|
|
|
|
opt.signcolumn = 'yes:2' -- Signs column always on, minimum 2.
|
|
|
|
|
opt.wrap = true
|
|
|
|
|
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
-- Memory, CPU
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
opt.hidden = true -- Enable background buffers
|
|
|
|
|
opt.history = 100 -- Remember N lines in historma:y
|
|
|
|
|
opt.lazyredraw = true -- Faster scrolling
|
|
|
|
|
opt.synmaxcol = 240 -- Max column for syntax highlight
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
-- Colorscheme
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
opt.termguicolors = true -- Enable 24-bit RGB colors
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
-- Tabs, indent
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
opt.expandtab = true -- Use spaces instead of tabs
|
|
|
|
|
opt.shiftwidth = 1 -- Shift 4 spaces when tab
|
|
|
|
|
opt.tabstop = 1 -- 1 tab == 4 spaces
|
|
|
|
|
opt.smartindent = true -- Autoindent new lines
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
-- Glow Settings
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
g.glow_binary_path = '/bin'
|
|
|
|
|
g.glow_border = 'rounded'
|
|
|
|
|
g.glow_width = 120
|
|
|
|
|
g.glow_use_pager = true
|
|
|
|
|
g.glow_style = 'dark'
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
-- MKDX Settings, mkdx#settings.
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
-- 2 spaces for selected filetypes
|
|
|
|
|
cmd [[
|
|
|
|
|
autocmd FileType md,liquid,xml,html,xhtml,css,scss,javascript,lua,yaml setlocal shiftwidth=2 tabstop=8 noexpandtab
|
|
|
|
|
]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local disabled_built_ins = {
|
|
|
|
|
"netrw",
|
|
|
|
|
"netrwPlugin",
|
|
|
|
|
"netrwSettings",
|
|
|
|
|
"netrwFileHandlers",
|
|
|
|
|
"gzip",
|
|
|
|
|
"zip",
|
|
|
|
|
"zipPlugin",
|
|
|
|
|
"tar",
|
|
|
|
|
"tarPlugin",
|
|
|
|
|
"getscript",
|
|
|
|
|
"getscriptPlugin",
|
|
|
|
|
"vimball",
|
|
|
|
|
"vimballPlugin",
|
|
|
|
|
"2html_plugin",
|
|
|
|
|
"logipat",
|
|
|
|
|
"rrhelper",
|
|
|
|
|
"spellfile_plugin",
|
|
|
|
|
"matchit"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for _, plugin in pairs(disabled_built_ins) do
|
|
|
|
|
vim.g["loaded_" .. plugin] = 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--[[
|
|
|
|
|
Deletes all trailing whitespaces in a file if it's not binary nor a diff.
|
|
|
|
|
]]--
|
|
|
|
|
function _G.trim_trailing_whitespaces()
|
|
|
|
|
if not o.binary and o.filetype ~= 'diff' then
|
|
|
|
|
local current_view = fn.winsaveview()
|
|
|
|
|
cmd([[keeppatterns %s/\s\+$//e]])
|
|
|
|
|
fn.winrestview(current_view)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- require('settings')
|
|
|
|
|
--require('keymaps')
|
|
|
|
|
--require('plugins/plugins'),
|
|
|
|
|
--require('plugins/nvim-tree'),
|
|
|
|
|
--require('plugins/indent-blankline'),
|
|
|
|
|
--require('plugins/feline'),
|
|
|
|
|
--require('plugins/nvim-cmp'),
|
|
|
|
|
--require('plugins/nvim-lspconfig'),
|
|
|
|
|
--require('plugins/nvim-treesitter'),
|
|
|
|
|
--require('plugins/alpha-nvim'),
|
|
|
|
|
--require('plugins/telescope'),
|
|
|
|
|
--require('plugins/symbols-outline'),
|
|
|
|
|
--require('plugins/mason-lspconfig'),
|
|
|
|
|
--require('plugins/snippets'),
|
|
|
|
|
--require('plugins/neoscroll'),
|
|
|
|
|
--require('plugins/null-ls'),
|
|
|
|
|
--require('plugins/nvim-mapper'),
|
|
|
|
|
--require('plugins/todo-comments')
|