ft alias
This commit is contained in:
parent
691a449b30
commit
4c102a131b
|
@ -2,7 +2,7 @@ local opt = vim.opt
|
||||||
local g = vim.g
|
local g = vim.g
|
||||||
g.maplocalleader = ";"
|
g.maplocalleader = ";"
|
||||||
|
|
||||||
opt.mouse = "a" -- mouse does annoying things for me if it's not 'a'
|
opt.mouse = "a" -- mouse does annoying things for me if it's not 'a'
|
||||||
opt.signcolumn = "yes"
|
opt.signcolumn = "yes"
|
||||||
opt.clipboard = "" -- don't just use the system clipboard
|
opt.clipboard = "" -- don't just use the system clipboard
|
||||||
opt.wrap = false
|
opt.wrap = false
|
||||||
|
@ -19,13 +19,13 @@ opt.shada = { "'1000", "<50", "s10", "h" }
|
||||||
-- Tabs and Indents
|
-- Tabs and Indents
|
||||||
-- ===
|
-- ===
|
||||||
|
|
||||||
opt.textwidth = 80 -- Text width maximum chars before wrapping
|
opt.textwidth = 80 -- Text width maximum chars before wrapping
|
||||||
opt.tabstop = 4 -- The number of spaces a tab is
|
opt.tabstop = 4 -- The number of spaces a tab is
|
||||||
opt.shiftwidth = 4 -- Number of spaces to use in auto(indent)
|
opt.shiftwidth = 4 -- Number of spaces to use in auto(indent)
|
||||||
opt.smarttab = true -- Tab insert blanks according to 'shiftwidth'
|
opt.smarttab = true -- Tab insert blanks according to 'shiftwidth'
|
||||||
opt.autoindent = true -- Use same indenting on new lines
|
opt.autoindent = true -- Use same indenting on new lines
|
||||||
opt.smartindent = true -- Smart autoindenting on new lines
|
opt.smartindent = true -- Smart autoindenting on new lines
|
||||||
opt.shiftround = true -- Round indent to multiple of 'shiftwidth'
|
opt.shiftround = true -- Round indent to multiple of 'shiftwidth'
|
||||||
|
|
||||||
-- Timing
|
-- Timing
|
||||||
-- ===
|
-- ===
|
||||||
|
@ -37,18 +37,18 @@ opt.updatetime = 500 -- Idle time to write swap and trigger CursorHold
|
||||||
-- Searching
|
-- Searching
|
||||||
-- ===
|
-- ===
|
||||||
opt.ignorecase = true -- Search ignoring case
|
opt.ignorecase = true -- Search ignoring case
|
||||||
opt.smartcase = true -- Keep case when searching with *
|
opt.smartcase = true -- Keep case when searching with *
|
||||||
opt.infercase = true -- Adjust case in insert completion mode
|
opt.infercase = true -- Adjust case in insert completion mode
|
||||||
opt.incsearch = true -- Incremental search
|
opt.incsearch = true -- Incremental search
|
||||||
|
|
||||||
-- Formatting
|
-- Formatting
|
||||||
-- ===
|
-- ===
|
||||||
|
|
||||||
opt.wrap = false -- No wrap by default
|
opt.wrap = false -- No wrap by default
|
||||||
opt.linebreak = true -- Break long lines at 'breakat'
|
opt.linebreak = true -- Break long lines at 'breakat'
|
||||||
opt.breakat = "\\ \\ ;:,!?" -- Long lines break chars
|
opt.breakat = "\\ \\ ;:,!?" -- Long lines break chars
|
||||||
opt.startofline = false -- Cursor in same column for few commands
|
opt.startofline = false -- Cursor in same column for few commands
|
||||||
opt.splitbelow = true -- Splits open bottom right
|
opt.splitbelow = true -- Splits open bottom right
|
||||||
opt.splitright = true
|
opt.splitright = true
|
||||||
opt.breakindentopt = { shift = 2, min = 20 }
|
opt.breakindentopt = { shift = 2, min = 20 }
|
||||||
opt.formatoptions = "qnlmBjp" -- see :h fo-table & :h formatoptions
|
opt.formatoptions = "qnlmBjp" -- see :h fo-table & :h formatoptions
|
||||||
|
@ -70,31 +70,31 @@ opt.foldlevel = 10 -- start with all folds open
|
||||||
vim.o.guifont = "FiraCode Nerd Font:h22"
|
vim.o.guifont = "FiraCode Nerd Font:h22"
|
||||||
opt.termguicolors = true
|
opt.termguicolors = true
|
||||||
opt.shortmess = "xsTOInfFitloCaAs"
|
opt.shortmess = "xsTOInfFitloCaAs"
|
||||||
opt.showmode = true -- Show mode in cmd window
|
opt.showmode = true -- Show mode in cmd window
|
||||||
opt.scrolloff = 2 -- Keep at least n lines above/below
|
opt.scrolloff = 2 -- Keep at least n lines above/below
|
||||||
opt.sidescrolloff = 0 -- Keep at least n lines left/right
|
opt.sidescrolloff = 0 -- Keep at least n lines left/right
|
||||||
opt.numberwidth = 2 -- Minimum number of columns to use for the line number
|
opt.numberwidth = 2 -- Minimum number of columns to use for the line number
|
||||||
opt.number = true -- Show line numbers
|
opt.number = true -- Show line numbers
|
||||||
opt.ruler = true -- Default status ruler
|
opt.ruler = true -- Default status ruler
|
||||||
opt.list = true -- Show hidden characters
|
opt.list = true -- Show hidden characters
|
||||||
opt.showtabline = 1 -- Don't change this, goes back to a vanilla vim default
|
opt.showtabline = 1 -- Don't change this, goes back to a vanilla vim default
|
||||||
opt.laststatus = 3 -- Always show laststatus
|
opt.laststatus = 3 -- Always show laststatus
|
||||||
|
|
||||||
if vim.g.started_by_firenvim == true then
|
if vim.g.started_by_firenvim == true then
|
||||||
opt.showtabline = 1 -- Don't show tabline in firenvim, unless multitab
|
opt.showtabline = 1 -- Don't show tabline in firenvim, unless multitab
|
||||||
opt.laststatus = 1 -- Don't show laststatus in firenvim
|
opt.laststatus = 1 -- Don't show laststatus in firenvim
|
||||||
opt.wrap = true
|
opt.wrap = true
|
||||||
end
|
end
|
||||||
|
|
||||||
opt.helpheight = 0 -- Disable help window resizing
|
opt.helpheight = 0 -- Disable help window resizing
|
||||||
opt.winwidth = 30 -- Minimum width for active window
|
opt.winwidth = 30 -- Minimum width for active window
|
||||||
opt.winminwidth = 1 -- Minimum width for inactive windows
|
opt.winminwidth = 1 -- Minimum width for inactive windows
|
||||||
opt.winheight = 1 -- Minimum height for active window
|
opt.winheight = 1 -- Minimum height for active window
|
||||||
opt.winminheight = 1 -- Minimum height for inactive window
|
opt.winminheight = 1 -- Minimum height for inactive window
|
||||||
|
|
||||||
opt.showcmd = false -- show command in status line
|
opt.showcmd = false -- show command in status line
|
||||||
opt.cmdheight = 0
|
opt.cmdheight = 0
|
||||||
opt.cmdwinheight = 5 -- Command-line lines
|
opt.cmdwinheight = 5 -- Command-line lines
|
||||||
opt.equalalways = true -- Resize windows on split or close
|
opt.equalalways = true -- Resize windows on split or close
|
||||||
opt.colorcolumn = "+0" -- Column highlight at textwidth's max character-limit
|
opt.colorcolumn = "+0" -- Column highlight at textwidth's max character-limit
|
||||||
|
|
||||||
|
@ -102,8 +102,8 @@ opt.cursorline = true
|
||||||
opt.cursorlineopt = { "number", "screenline" }
|
opt.cursorlineopt = { "number", "screenline" }
|
||||||
|
|
||||||
opt.pumheight = 10 -- Maximum number of items to show in the popup menu
|
opt.pumheight = 10 -- Maximum number of items to show in the popup menu
|
||||||
opt.pumwidth = 10 -- Minimum width for the popup menu
|
opt.pumwidth = 10 -- Minimum width for the popup menu
|
||||||
opt.pumblend = 10 -- Popup blend
|
opt.pumblend = 10 -- Popup blend
|
||||||
|
|
||||||
-- Spelling correction
|
-- Spelling correction
|
||||||
-- ===
|
-- ===
|
||||||
|
@ -115,50 +115,53 @@ opt.spellsuggest = "double,50,timeout:5000"
|
||||||
-- autocommands
|
-- autocommands
|
||||||
-- ===
|
-- ===
|
||||||
local function augroup(name)
|
local function augroup(name)
|
||||||
return vim.api.nvim_create_augroup("plex_" .. name, {})
|
return vim.api.nvim_create_augroup("plex_" .. name, {})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- highlight on yank
|
-- highlight on yank
|
||||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
group = augroup "highlight_yank",
|
group = augroup "highlight_yank",
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.highlight.on_yank()
|
vim.highlight.on_yank()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Disable conceallevel for specific file-types.
|
-- Disable conceallevel for specific file-types.
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
group = augroup "fix_conceallevel",
|
group = augroup "fix_conceallevel",
|
||||||
pattern = { "latex", "tex" },
|
pattern = { "latex", "tex" },
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.opt_local.conceallevel = 0
|
vim.opt_local.conceallevel = 0
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Resize splits if window got resized
|
-- Resize splits if window got resized
|
||||||
vim.api.nvim_create_autocmd("VimResized", {
|
vim.api.nvim_create_autocmd("VimResized", {
|
||||||
group = augroup "resize_splits",
|
group = augroup "resize_splits",
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.cmd "wincmd ="
|
vim.cmd "wincmd ="
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Wrap and enable spell-checker in text filetypes
|
-- Wrap and enable spell-checker in text filetypes
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
group = augroup "spell_conceal",
|
group = augroup "spell_conceal",
|
||||||
pattern = { "gitcommit", "markdown", "tex", "latex", "norg" },
|
pattern = { "gitcommit", "markdown", "tex", "latex", "norg" },
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.opt_local.spell = true
|
vim.opt_local.spell = true
|
||||||
vim.opt_local.conceallevel = 0
|
vim.opt_local.conceallevel = 0
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- map resizing for firenvim
|
-- map resizing for firenvim
|
||||||
if vim.g.started_by_firenvim == true then
|
if vim.g.started_by_firenvim == true then
|
||||||
vim.keymap.set("n", "<leader><C-DOWN>", function()
|
vim.keymap.set("n", "<leader><C-DOWN>", function()
|
||||||
vim.o.lines = vim.o.lines + 1
|
vim.o.lines = vim.o.lines + 1
|
||||||
end, { expr = true, desc = "Make Display bigger" })
|
end, { expr = true, desc = "Make Display bigger" })
|
||||||
vim.keymap.set("n", "<leader><C-UP>", function()
|
vim.keymap.set("n", "<leader><C-UP>", function()
|
||||||
vim.o.lines = vim.o.lines - 1
|
vim.o.lines = vim.o.lines - 1
|
||||||
end, { expr = true, desc = "Make Display smaller" })
|
end, { expr = true, desc = "Make Display smaller" })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- alias filetypes
|
||||||
|
vim.filetype.add { extension = { tera = 'html' } }
|
||||||
|
|
Loading…
Reference in New Issue