-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.lua
44 lines (37 loc) · 1.06 KB
/
base.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
vim.opt.fileencoding = 'utf-8'
-- Indenting
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.smartindent = true
-- Texting
vim.opt.wrap = false
vim.opt.ignorecase = true
vim.opt.smartcase = true
-- UI
vim.opt.scrolloff = 10
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.cursorline = true
vim.opt.termguicolors = true
vim.opt.splitbelow = true
vim.opt.splitright = true
vim.opt.wildmode = 'list:longest,full'
-- Misc
vim.opt.swapfile = false
vim.opt.undofile = true
vim.opt.clipboard:append({ 'unnamedplus' })
-- Highlight Yanked Text
vim.api.nvim_create_autocmd({ 'TextYankPost' }, {
callback = function()
vim.highlight.on_yank({ timeout = 200 })
end,
})
-- Yank current buffer file relative path into system clipboard
vim.api.nvim_create_user_command('CopyPath', function()
local path = vim.fn.expand('%')
vim.fn.setreg('+', path)
vim.notify('Copied "' .. path .. '" to the clipboard')
end, {})
local clean_undo_files = require('utils').clean_undo_files
vim.api.nvim_create_user_command('CleanUndoFiles', clean_undo_files, {})