nvim: nasty, mid-rewrite update
This commit is contained in:
@@ -1,23 +1,22 @@
|
||||
if not vim.filetype then
|
||||
return
|
||||
local M = {}
|
||||
|
||||
function M.config()
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
yml = 'yaml',
|
||||
docker = 'dockerfile',
|
||||
},
|
||||
filename = {
|
||||
['.gitignore'] = 'conf',
|
||||
Podfile = 'ruby',
|
||||
Brewfile = 'ruby',
|
||||
Vagrantfile = 'ruby',
|
||||
},
|
||||
pattern = {
|
||||
['*.gradle'] = 'groovy',
|
||||
['*.env.*'] = 'env',
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
-- vim.g.did_load_filetypes = 0 -- deactivate vim based filetype detection
|
||||
-- vim.g.do_filetype_lua = 1 -- enable lua ft detection
|
||||
--
|
||||
-- vim.filetype.add({
|
||||
-- extension = {
|
||||
-- -- yml = 'yaml',
|
||||
-- docker = 'dockerfile',
|
||||
-- },
|
||||
-- filename = {
|
||||
-- ['.gitignore'] = 'conf',
|
||||
-- Podfile = 'ruby',
|
||||
-- Brewfile = 'ruby',
|
||||
-- Vagrantfile = 'ruby',
|
||||
-- },
|
||||
-- pattern = {
|
||||
-- ['*.gradle'] = 'groovy',
|
||||
-- ['*.env.*'] = 'env',
|
||||
-- },
|
||||
-- })
|
||||
return M
|
||||
|
||||
@@ -30,6 +30,7 @@ nmap('L', '$')
|
||||
nmap('J', 'mzJ`z')
|
||||
nmap('K', '<Nop>')
|
||||
nmap('gQ', '<Nop>')
|
||||
nmap('vv', ':vs<CR>')
|
||||
|
||||
-- Tabs
|
||||
nmap('<leader>t', ':tabnew<CR>')
|
||||
@@ -48,12 +49,6 @@ map('v', 'K', ':m \'<-2<CR>gv=gv')
|
||||
map('v', '<', '<gv')
|
||||
map('v', '>', '>gv')
|
||||
|
||||
-- Telescope
|
||||
nmap('<leader>ff', ':lua require("telescope.builtin").find_files({ hidden = true })<CR>')
|
||||
-- TODO: change to Telescope
|
||||
-- nmap('<leader>ft', ':Files ~/Tmp<CR>')
|
||||
-- nmap('<leader>fo', ":call fzf#run(fzf#wrap(fzf#vim#with_preview({ 'source': 'fd . --type f --extension=md --follow --exclude .git ~/Syncthing/Obsidian/Personal' })))<CR>", { silent = true })
|
||||
|
||||
-- vim-easy-align
|
||||
map('x', 'ga', ':EasyAlign<CR>') -- TODO: this should allow for gaip, but does not
|
||||
map('v', 'ga', ':EasyAlign<CR>')
|
||||
@@ -76,8 +71,11 @@ nmap('<leader>gb',':Git blame<CR>')
|
||||
nmap('<leader>a', ':A<CR>')
|
||||
|
||||
-- test
|
||||
nmap('<leader>r', ':TestFile<CR>')
|
||||
nmap('<leader>R', ':TestSuite<CR>')
|
||||
-- nmap('<leader>r', ':TestFile<CR>')
|
||||
-- nmap('<leader>R', ':TestSuite<CR>')
|
||||
|
||||
-- CtrlSF
|
||||
nmap('<C-f>', '<Plug>CtrlSFPrompt')
|
||||
|
||||
-- trim whitespace
|
||||
nmap('<leader>W', ':TrimWhitespace<CR>')
|
||||
|
||||
@@ -55,7 +55,7 @@ cmp.setup({
|
||||
|
||||
-- Set up lspconfig.
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
require('lspconfig')['solargraph'].setup({ capabilities = capabilities })
|
||||
-- require('lspconfig')['solargraph'].setup({ capabilities = capabilities })
|
||||
|
||||
-- require("luasnip.loaders.from_lua").lazy_load()
|
||||
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
local g = vim.g -- a table to access global variables
|
||||
|
||||
local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
|
||||
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
||||
vim.fn.execute('!git clone https://github.com/wbthomason/packer.nvim ' .. install_path)
|
||||
end
|
||||
|
||||
require('packer').startup(function()
|
||||
use 'wbthomason/packer.nvim'
|
||||
use 'shaunsingh/nord.nvim'
|
||||
use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' }
|
||||
use 'tpope/vim-surround'
|
||||
use { 'junegunn/fzf', run = 'cd ~/.fzf && ./install --all' }
|
||||
use 'junegunn/fzf.vim'
|
||||
use 'junegunn/vim-easy-align'
|
||||
use 'christoomey/vim-tmux-navigator'
|
||||
use 'airblade/vim-gitgutter'
|
||||
use 'tpope/vim-repeat'
|
||||
use 'nvim-tree/nvim-tree.lua'
|
||||
use 'numtostr/comment.nvim'
|
||||
use 'ellisonleao/glow.nvim'
|
||||
|
||||
-- Snippets
|
||||
use 'L3MON4D3/LuaSnip'
|
||||
use 'hrsh7th/nvim-cmp'
|
||||
use 'hrsh7th/cmp-nvim-lsp'
|
||||
use 'saadparwaiz1/cmp_luasnip'
|
||||
use "rafamadriz/friendly-snippets"
|
||||
|
||||
use 'neovim/nvim-lspconfig'
|
||||
|
||||
-- tpope
|
||||
use 'tpope/vim-fugitive'
|
||||
use 'tpope/vim-rails'
|
||||
use 'tpope/vim-rhubarb'
|
||||
|
||||
-- tests
|
||||
use 'vim-test/vim-test'
|
||||
use 'benmills/vimux'
|
||||
|
||||
use 'dyng/ctrlsf.vim'
|
||||
|
||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built. Only load if `make` is available
|
||||
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make', cond = vim.fn.executable "make" == 1 }
|
||||
use { 'nvim-telescope/telescope.nvim', branch = '0.1.x', requires = { 'nvim-lua/plenary.nvim' } }
|
||||
|
||||
use "williamboman/mason.nvim"
|
||||
use "WhoIsSethDaniel/mason-tool-installer.nvim"
|
||||
use "jose-elias-alvarez/null-ls.nvim"
|
||||
use({
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
requires = {
|
||||
"neovim/nvim-lspconfig",
|
||||
}
|
||||
})
|
||||
use 'AndrewRadev/splitjoin.vim'
|
||||
end)
|
||||
|
||||
require 'plugins/treesitter'
|
||||
require 'plugins/gitgutter'
|
||||
require 'plugins/lsp'
|
||||
require 'plugins/cmp'
|
||||
require 'plugins/nord'
|
||||
require 'plugins/nvim-tree'
|
||||
require 'plugins/comment'
|
||||
require 'plugins/mason'
|
||||
require 'plugins/null-ls'
|
||||
require 'plugins/telescope'
|
||||
|
||||
-- vim-test
|
||||
g['test#strategy'] = 'vimux'
|
||||
|
||||
-- CtrlSF
|
||||
g.ctrlsf_ackprg = 'rg'
|
||||
g.ctrlsf_regex_pattern = 1
|
||||
g.ctrlsf_case_sensitive = 'smart'
|
||||
g.ctrlsf_default_root = 'project'
|
||||
g.ctrlsf_context = '-B 1 -A 1'
|
||||
g.ctrlsf_position = 'bottom'
|
||||
g.ctrlsf_winsize = '40%'
|
||||
g.ctrlsf_mapping = {
|
||||
next = 'n',
|
||||
prev = 'N',
|
||||
}
|
||||
@@ -1,47 +1,111 @@
|
||||
require("mason-lspconfig").setup()
|
||||
local lspconfig = require('lspconfig')
|
||||
lspconfig.ansiblels.setup({})
|
||||
lspconfig.bashls.setup({})
|
||||
lspconfig.dockerls.setup({})
|
||||
lspconfig.gopls.setup({})
|
||||
lspconfig.jsonls.setup({})
|
||||
lspconfig.solargraph.setup({})
|
||||
lspconfig.marksman.setup({})
|
||||
lspconfig.terraformls.setup({})
|
||||
lspconfig.vimls.setup({})
|
||||
lspconfig.pylsp.setup({})
|
||||
lspconfig.yamlls.setup({})
|
||||
-- local M = {}
|
||||
--
|
||||
-- function M.config()
|
||||
-- local lspconfig = require('lspconfig')
|
||||
--
|
||||
-- lspconfig.ansiblels.setup({})
|
||||
-- lspconfig.bashls.setup({})
|
||||
-- lspconfig.dockerls.setup({})
|
||||
-- lspconfig.gopls.setup({})
|
||||
-- lspconfig.jsonls.setup({})
|
||||
-- lspconfig.solargraph.setup({})
|
||||
--
|
||||
-- -- local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
-- -- require('lspconfig')['solargraph'].setup({ capabilities = capabilities })
|
||||
--
|
||||
-- lspconfig.marksman.setup({})
|
||||
-- lspconfig.terraformls.setup({})
|
||||
-- lspconfig.vimls.setup({})
|
||||
-- lspconfig.pylsp.setup({})
|
||||
-- lspconfig.yamlls.setup({
|
||||
-- settings = {
|
||||
-- yaml = {
|
||||
-- format = {
|
||||
-- enable = true,
|
||||
-- singleQuote = true
|
||||
-- }
|
||||
-- }
|
||||
-- }
|
||||
-- })
|
||||
--
|
||||
-- require("mason").setup({})
|
||||
-- require("mason-lspconfig").setup()
|
||||
-- require("mason-tool-installer").setup({
|
||||
-- -- https://github.com/williamboman/mason-lspconfig.nvim/blob/main/doc/server-mapping.md
|
||||
-- ensure_installed = { "bash-language-server", "black", "dockerfile-language-server",
|
||||
-- "isort", "json-lsp", "jsonlint", "lua-language-server", "marksman", "prettierd",
|
||||
-- "python-lsp-server", "rubocop", "shfmt", "solargraph", "terraform-ls",
|
||||
-- "vim-language-server", "yaml-language-server",
|
||||
-- },
|
||||
-- auto_update = true,
|
||||
-- run_on_start = true
|
||||
-- })
|
||||
--
|
||||
-- -- Provide settings that should only apply to the "sumneko_lua" server
|
||||
-- local lua_runtime_path = vim.split(package.path, ';')
|
||||
-- table.insert(lua_runtime_path, "lua/?.lua")
|
||||
-- table.insert(lua_runtime_path, "lua/?/init.lua")
|
||||
-- table.insert(lua_runtime_path, vim.fn.stdpath('config') .. "lua/?.lua")
|
||||
--
|
||||
-- lspconfig.sumneko_lua.setup({
|
||||
-- settings = {
|
||||
-- Lua = {
|
||||
-- runtime = {
|
||||
-- -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
-- version = 'LuaJIT',
|
||||
-- -- Setup your lua path
|
||||
-- path = lua_runtime_path,
|
||||
-- },
|
||||
-- format = {
|
||||
-- enable = true,
|
||||
-- defaultConfig = {
|
||||
-- keep_one_space_between_table_and_bracket = "false",
|
||||
-- }
|
||||
-- },
|
||||
-- diagnostics = {
|
||||
-- -- Get the language server to recognize the `vim` global
|
||||
-- globals = {'vim'},
|
||||
-- ["codestyle-check"] = "Any",
|
||||
-- },
|
||||
-- -- Do not send telemetry data containing a randomized but unique identifier
|
||||
-- telemetry = {
|
||||
-- enable = false,
|
||||
-- },
|
||||
-- },
|
||||
-- }
|
||||
-- })
|
||||
-- end
|
||||
|
||||
-- Provide settings that should only apply to the "sumneko_lua" server
|
||||
local lua_runtime_path = vim.split(package.path, ';')
|
||||
table.insert(lua_runtime_path, "lua/?.lua")
|
||||
table.insert(lua_runtime_path, "lua/?/init.lua")
|
||||
table.insert(lua_runtime_path, vim.fn.stdpath('config') .. "lua/?.lua")
|
||||
|
||||
lspconfig.sumneko_lua.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
-- Setup your lua path
|
||||
path = lua_runtime_path,
|
||||
},
|
||||
format = {
|
||||
enable = true,
|
||||
defaultConfig = {
|
||||
keep_one_space_between_table_and_bracket = "false",
|
||||
}
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = {'vim'},
|
||||
["codestyle-check"] = "Any",
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
|
||||
local lsp = require('lsp-zero')
|
||||
|
||||
-- lsp.preset('recommended')
|
||||
lsp.set_preferences({
|
||||
suggest_lsp_servers = true,
|
||||
setup_servers_on_start = true,
|
||||
set_lsp_keymaps = true,
|
||||
configure_diagnostics = true,
|
||||
cmp_capabilities = true,
|
||||
manage_nvim_cmp = true,
|
||||
call_servers = 'local',
|
||||
sign_icons = {
|
||||
error = 'E',
|
||||
warn = 'W',
|
||||
hint = 'H',
|
||||
info = 'I'
|
||||
}
|
||||
})
|
||||
|
||||
lsp.setup()
|
||||
|
||||
-- should be after setup
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
signs = true,
|
||||
update_in_insert = false,
|
||||
underline = true,
|
||||
severity_sort = false,
|
||||
float = true,
|
||||
})
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
require("mason").setup({})
|
||||
require("mason-tool-installer").setup({
|
||||
-- https://github.com/williamboman/mason-lspconfig.nvim/blob/main/doc/server-mapping.md
|
||||
ensure_installed = { "bash-language-server", "black", "dockerfile-language-server",
|
||||
"isort", "json-lsp", "jsonlint", "lua-language-server", "marksman", "prettierd",
|
||||
"python-lsp-server", "rubocop", "shfmt", "solargraph", "terraform-ls",
|
||||
"vim-language-server", "yaml-language-server",
|
||||
},
|
||||
auto_update = true,
|
||||
run_on_start = true
|
||||
})
|
||||
-- require("mason").setup({})
|
||||
-- require("mason-tool-installer").setup({
|
||||
-- -- https://github.com/williamboman/mason-lspconfig.nvim/blob/main/doc/server-mapping.md
|
||||
-- ensure_installed = { "bash-language-server", "black", "dockerfile-language-server",
|
||||
-- "isort", "json-lsp", "jsonlint", "lua-language-server", "marksman", "prettierd",
|
||||
-- "python-lsp-server", "rubocop", "shfmt", "solargraph", "terraform-ls",
|
||||
-- "vim-language-server", "yaml-language-server",
|
||||
-- },
|
||||
-- auto_update = true,
|
||||
-- run_on_start = true
|
||||
-- })
|
||||
|
||||
@@ -1,30 +1,37 @@
|
||||
-- https://github.com/shaunsingh/nord.nvim#%EF%B8%8F-configuration
|
||||
local M = {}
|
||||
|
||||
-- Make sidebars and popup menus like nvim-tree and telescope
|
||||
-- have a different background
|
||||
vim.g.nord_contrast = true
|
||||
function M.setup()
|
||||
-- https://github.com/shaunsingh/nord.nvim#%EF%B8%8F-configuration
|
||||
|
||||
-- Enable the border between verticaly split windows visable
|
||||
vim.g.nord_borders = true
|
||||
-- Make sidebars and popup menus like nvim-tree and telescope
|
||||
-- have a different background
|
||||
vim.g.nord_contrast = true
|
||||
|
||||
-- Disable the setting of background color so that NeoVim
|
||||
-- can use your terminal background
|
||||
vim.g.nord_disable_background = false
|
||||
-- Enable the border between verticaly split windows visable
|
||||
vim.g.nord_borders = true
|
||||
|
||||
-- Set the cursorline transparent/visible
|
||||
vim.g.nord_cursorline_transparent = false
|
||||
-- Disable the setting of background color so that NeoVim
|
||||
-- can use your terminal background
|
||||
vim.g.nord_disable_background = false
|
||||
|
||||
-- Re-enables the background of the sidebar if you disabled the background of everything
|
||||
vim.g.nord_enable_sidebar_background = false
|
||||
-- Set the cursorline transparent/visible
|
||||
vim.g.nord_cursorline_transparent = false
|
||||
|
||||
-- Enables/disables italics
|
||||
vim.g.nord_italic = true
|
||||
-- Re-enables the background of the sidebar if you disabled the background of everything
|
||||
vim.g.nord_enable_sidebar_background = false
|
||||
|
||||
-- Enables/disables colorful backgrounds when used in diff mode
|
||||
vim.g.nord_uniform_diff_background = true
|
||||
-- Enables/disables italics
|
||||
vim.g.nord_italic = true
|
||||
|
||||
-- Enables/disables bold
|
||||
vim.g.nord_bold = false
|
||||
-- Enables/disables colorful backgrounds when used in diff mode
|
||||
vim.g.nord_uniform_diff_background = true
|
||||
|
||||
-- Load the colorscheme
|
||||
require('nord').set()
|
||||
-- Enables/disables bold
|
||||
vim.g.nord_bold = false
|
||||
end
|
||||
|
||||
function M.config()
|
||||
require('nord').set()
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
@@ -1,2 +1,54 @@
|
||||
-- Enable telescope fzf native, if installed
|
||||
pcall(require('telescope').load_extension, 'fzf')
|
||||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
vim.keymap.set('n', '<leader>ff', function() require('telescope.builtin').find_files({ hidden = true }) end)
|
||||
vim.keymap.set('n', '<leader>fh', function() require('telescope.builtin').help_tags() end)
|
||||
-- require('telescope.builtin').find_files({ hidden = true })
|
||||
end
|
||||
|
||||
function M.config()
|
||||
local telescope = require 'telescope'
|
||||
|
||||
telescope.setup {
|
||||
defaults = {
|
||||
layout_strategy = 'vertical',
|
||||
winblend = 7,
|
||||
set_env = { COLORTERM = 'truecolor' },
|
||||
color_devicons = true,
|
||||
scroll_strategy = 'limit',
|
||||
},
|
||||
pickers = {
|
||||
live_grep = {
|
||||
only_sort_text = true,
|
||||
path_display = { 'shorten' },
|
||||
layout_strategy = 'horizontal',
|
||||
layout_config = { preview_width = 0.4 },
|
||||
},
|
||||
git_files = {
|
||||
path_display = {},
|
||||
hidden = true,
|
||||
show_untracked = true,
|
||||
layout_strategy = 'horizontal',
|
||||
layout_config = { preview_width = 0.65 },
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
override_generic_sorter = true,
|
||||
override_file_sorter = true,
|
||||
case_mode = 'smart_case',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- pcall(require('telescope').load_extension, 'fzf')
|
||||
-- Enable telescope fzf native, if installed
|
||||
telescope.load_extension('fzf')
|
||||
end
|
||||
|
||||
-- Telescope
|
||||
-- TODO: change to Telescope
|
||||
-- nmap('<leader>ft', ':Files ~/Tmp<CR>')
|
||||
-- nmap('<leader>fo', ":call fzf#run(fzf#wrap(fzf#vim#with_preview({ 'source': 'fd . --type f --extension=md --follow --exclude .git ~/Syncthing/Obsidian/Personal' })))<CR>", { silent = true })
|
||||
|
||||
return M
|
||||
|
||||
@@ -1,27 +1,32 @@
|
||||
-- Tree-sitter
|
||||
require('nvim-treesitter.configs').setup {
|
||||
-- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||
ensure_installed = { 'bash', 'c', 'cpp', 'c_sharp', 'clojure', 'cmake', 'comment', 'commonlisp',
|
||||
'css', 'dockerfile', 'elixir', 'erlang', 'fish', 'go', 'html', 'http', 'java',
|
||||
'javascript', 'json', 'kotlin', 'latex', 'lua', 'make', 'markdown', 'perl', 'php',
|
||||
'python', 'ruby', 'rust', 'scss', 'swift', 'toml', 'tsx', 'vim', 'vue', 'yaml' },
|
||||
-- ignore_install = { 'norg' },
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
enable_autocmd = false,
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
disable = { "html" },
|
||||
extended_mode = false,
|
||||
max_file_lines = nil,
|
||||
},
|
||||
indent = { enable = false },
|
||||
autopairs = { enable = true },
|
||||
autotag = { enable = true },
|
||||
incremental_selection = { enable = true },
|
||||
}
|
||||
local M = {}
|
||||
|
||||
function M.config()
|
||||
require('nvim-treesitter.configs').setup {
|
||||
-- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||
ensure_installed = { 'bash', 'c', 'cpp', 'c_sharp', 'clojure', 'cmake', 'comment', 'commonlisp',
|
||||
'css', 'dockerfile', 'elixir', 'erlang', 'fish', 'go', 'html', 'http', 'java',
|
||||
'javascript', 'json', 'kotlin', 'latex', 'lua', 'make', 'markdown', 'perl', 'php',
|
||||
'python', 'ruby', 'rust', 'scss', 'swift', 'toml', 'tsx', 'vim', 'vue', 'yaml' },
|
||||
-- ignore_install = { 'norg' },
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
enable_autocmd = false,
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
disable = { "html" },
|
||||
extended_mode = false,
|
||||
max_file_lines = nil,
|
||||
},
|
||||
indent = { enable = false },
|
||||
autopairs = { enable = true },
|
||||
autotag = { enable = true },
|
||||
incremental_selection = { enable = true },
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
-- TODO:
|
||||
-- " Conceal mostly for markdown TODO :h conceallevel
|
||||
-- set conceallevel=2
|
||||
-- " Highlight VCS conflict markers TODO: translate to LUA
|
||||
-- match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$'
|
||||
|
||||
-- local g = vim.g -- a table to access global variables
|
||||
local opt = vim.opt -- to set options
|
||||
local cmd = vim.cmd -- to set options
|
||||
|
||||
cmd('au TextYankPost * lua vim.highlight.on_yank { timeout = 250 }')
|
||||
cmd('colorscheme nord')
|
||||
|
||||
opt.smartindent = true -- Autoindenting when starting a new line
|
||||
opt.completeopt = {'menu', 'menuone', 'noselect'}
|
||||
opt.tabstop = 2 -- Tab counts as 2 columns
|
||||
opt.shiftwidth = 2 -- Numbers of spaces to (auto)indent
|
||||
opt.expandtab = true -- Tabs to spaces
|
||||
opt.clipboard = 'unnamedplus' -- Share clipboard with the OS
|
||||
opt.number = true -- Display line numbers
|
||||
opt.fillchars = {
|
||||
vert = '▕', -- alternatives │
|
||||
eob = ' ', -- suppress ~ at EndOfBuffer
|
||||
msgsep = '‾',
|
||||
diff = '⣿',
|
||||
fold = ' ',
|
||||
foldopen = '▾',
|
||||
foldsep = '│',
|
||||
foldclose = '▸',
|
||||
}
|
||||
opt.synmaxcol = 500 -- Do not try to highlight lines longer than 500 characters
|
||||
opt.lazyredraw = true -- Do not redraw while running macros
|
||||
opt.showmatch = true -- Show matching braces
|
||||
opt.matchtime = 2 -- Show matching braces for 2 tenths of second
|
||||
opt.showmode = true -- Shows when you are in insert mode
|
||||
opt.title = true -- Show title in console status bar
|
||||
opt.laststatus = 3 -- Single status line
|
||||
opt.wrap = false -- Dont wrap lines
|
||||
opt.scrolloff = 5 -- Keep 5 rows on the screen when scrolling
|
||||
opt.sidescrolloff = 15 -- Horizontal scrolloff
|
||||
opt.visualbell = false -- No visual bell
|
||||
opt.backup = false -- No backups
|
||||
opt.writebackup = false -- No backups
|
||||
opt.swapfile = false -- No backups
|
||||
opt.mouse = 'a' -- Support mouse (for proper mouse highlight)
|
||||
opt.list = true -- List mode
|
||||
opt.listchars = { trail = '·', tab = '->' }
|
||||
opt.timeoutlen = 1000 -- Delay for mappings
|
||||
opt.ttimeoutlen = 0 -- Delay between modes
|
||||
opt.shellcmdflag = '-ic' -- Enables aliases from .bashrc in :! commands
|
||||
opt.termguicolors = true -- 24-bit RGB color
|
||||
|
||||
|
||||
if vim.fn.executable('rg') > 0 then
|
||||
vim.o.grepprg = [[rg --glob "!.git" --no-heading --vimgrep --follow $*]]
|
||||
end
|
||||
|
||||
-- Use in vertical diff mode, blank lines to keep sides aligned, Ignore whitespace changes
|
||||
opt.diffopt = vim.opt.diffopt
|
||||
+ {
|
||||
'vertical',
|
||||
'iwhite',
|
||||
'hiddenoff',
|
||||
'foldcolumn:0',
|
||||
'context:4',
|
||||
'algorithm:histogram',
|
||||
'indent-heuristic',
|
||||
}
|
||||
|
||||
opt.shortmess = {
|
||||
t = true, -- truncate file messages at start
|
||||
A = true, -- ignore annoying swap file messages
|
||||
o = true, -- file-read message overwrites previous
|
||||
O = true, -- file-read message overwrites previous
|
||||
T = true, -- truncate non-file messages in middle
|
||||
f = true, -- (file x of x) instead of just (x of x
|
||||
F = true, -- Don't give file info when editing a file, NOTE: this breaks autocommand messages
|
||||
s = true,
|
||||
I = true, -- disable welcome message (:intro)
|
||||
a = true, -- shortmess for everything
|
||||
c = true,
|
||||
W = true, -- Don't show [w] or written when writing
|
||||
}
|
||||
|
||||
-- ignore when autocompleting
|
||||
opt.wildignore = {
|
||||
'*.aux', '*.out', '*.toc', '*.o', '*.obj',
|
||||
'*.dll', '*.jar', '*.pyc', '*.rbc', '*.class',
|
||||
'*.gif', '*.ico', '*.jpg', '*.jpeg', '*.png',
|
||||
'*.avi', '*.wav', '*.*~', '*~ ', '*.swp',
|
||||
'.lock', '.DS_Store', 'tags.lock'
|
||||
}
|
||||
Reference in New Issue
Block a user