first commit
This commit is contained in:
commit
02f0def35e
16 changed files with 422 additions and 0 deletions
92
lua/settings.lua
Normal file
92
lua/settings.lua
Normal file
|
@ -0,0 +1,92 @@
|
|||
-- General Option
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
vim.opt.autoindent = true
|
||||
vim.opt.background = 'dark'
|
||||
vim.opt.backupdir = os.getenv("HOME") .. '/.local/tmp/nvim'
|
||||
vim.opt.clipboard = 'unnamedplus' --Use system clipboard
|
||||
vim.opt.colorcolumn = '80'
|
||||
vim.opt.directory = os.getenv("HOME") .. '/.local/tmp/nvim'
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.foldmethod = 'syntax'
|
||||
vim.opt.gdefault = true -- search: all occurrences by default
|
||||
vim.opt.hlsearch = true -- search: hightlight terms
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.incsearch = true
|
||||
vim.opt.laststatus = 1
|
||||
-- show special character
|
||||
vim.opt.listchars = {tab = '→ ', trail = '␣', eol = '', extends = '…' }
|
||||
|
||||
vim.opt.signcolumn = "yes" -- alway show sign column
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.cursorline = true -- highlight current line
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.showmatch = true
|
||||
vim.opt.smartcase = true -- search: try :to be smart about cases
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.termguicolors = true -- 24 bits color support
|
||||
vim.opt.wildmenu = true -- activate enhanced user menu
|
||||
vim.opt.wildmode = 'lastused:full,list' -- enhance menu
|
||||
vim.opt.pumheight = 10
|
||||
vim.opt.pumwidth = 50
|
||||
vim.opt.pumblend = 10
|
||||
|
||||
-- Options than need vim.cmd
|
||||
-- vim.cmd('syntax on')
|
||||
|
||||
-- -- Code Fold
|
||||
-- "Load and save view atomatocally (save and restore fold)
|
||||
vim.cmd('au BufWinLeave *.* mkview')
|
||||
vim.cmd('au BufWinEnter *.* silent! loadview')
|
||||
|
||||
|
||||
-- Diagnostic settings
|
||||
--
|
||||
-- diagnostic windows must be float
|
||||
vim.diagnostic.config {
|
||||
virtual_text = false,
|
||||
signs = true,
|
||||
underline = true,
|
||||
}
|
||||
|
||||
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
||||
end
|
||||
|
||||
-- You will likely want to reduce updatetime which affects CursorHold
|
||||
-- note: this setting is global and should be set only once
|
||||
vim.o.updatetime = 250
|
||||
vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {scope='cursor', header = "", prefix = "", focus=false})]]
|
||||
|
||||
-- Autotype
|
||||
vim.cmd('au BufRead,BufNewFile *.md setlocal textwidth=80')
|
||||
vim.cmd('au BufRead,BufNewFile *.tex setlocal textwidth=80')
|
||||
vim.cmd('au BufNewFile,BufRead /tmp/neomutt* set tw=72 fo=awq comments+=nb:> noautoindent filetype=mail')
|
||||
|
||||
-- Ignore these filenames during enhanced command line completion.
|
||||
vim.opt.wildignore = {
|
||||
'*.bak',
|
||||
'*.class',
|
||||
'*.aux',
|
||||
'*.out',
|
||||
'*.toc',
|
||||
'*.jpg',
|
||||
'*.bmp',
|
||||
'*.gif',
|
||||
'*.png',
|
||||
'*.luac',
|
||||
'*.o',
|
||||
'*.obj',
|
||||
'*.exe',
|
||||
'*.dll',
|
||||
'*.manifest',
|
||||
'*.pyc',
|
||||
'*.spl',
|
||||
'*.sw?'
|
||||
}
|
Reference in a new issue