Added init.lua
This commit is contained in:
67
init.lua
Normal file
67
init.lua
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
-- Editor Settings
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
vim.opt.tabstop = 4
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
vim.opt.expandtab = false
|
||||||
|
vim.opt.list = true
|
||||||
|
vim.opt.listchars:append 'space:·'
|
||||||
|
vim.opt.path:append '**'
|
||||||
|
vim.opt.path:append '.'
|
||||||
|
vim.opt.wildmenu = true
|
||||||
|
vim.opt.wrap = false
|
||||||
|
vim.opt.foldenable = false
|
||||||
|
vim.opt.clipboard = 'unnamedplus'
|
||||||
|
vim.opt.undofile = true
|
||||||
|
vim.opt.ignorecase = true
|
||||||
|
vim.opt.smartcase = true
|
||||||
|
vim.opt.updatetime = 250
|
||||||
|
vim.opt.timeoutlen = 300
|
||||||
|
vim.opt.inccommand = 'split'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- Setup Netrw
|
||||||
|
vim.g.netrw_banner = 0
|
||||||
|
vim.g.netrw_sort_sequence = '[\\/]$'
|
||||||
|
vim.g.netrw_sort_options = 'i'
|
||||||
|
vim.g.netrw_silent = 1
|
||||||
|
--[[
|
||||||
|
vim.g.netrw_browse_split = 4
|
||||||
|
vim.g.netrw_altv = 1
|
||||||
|
vim.g.netrw_preview = 1
|
||||||
|
vim.g.netrw_winsize = 20
|
||||||
|
local mygroup = vim.api.nvim_create_augroup('loading_netrwPlugin', {clear = true})
|
||||||
|
vim.api.nvim_create_autocmd({'VimEnter'}, {
|
||||||
|
pattern = {'*'},
|
||||||
|
command = ':silent! Vexplore',
|
||||||
|
group = NetrwInit
|
||||||
|
})
|
||||||
|
]]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- Added autocmd for automatic insertmode in Terminal Mode
|
||||||
|
vim.api.nvim_create_autocmd({ 'TermOpen' }, {
|
||||||
|
pattern = { 'term://*' },
|
||||||
|
command = 'startinsert',
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- WriteSudo and ReadSudo hacks
|
||||||
|
vim.api.nvim_create_user_command('WriteSudo', 'w !sudo tee %', {})
|
||||||
|
vim.api.nvim_create_user_command('ReadSudo', function(opts)
|
||||||
|
vim.cmd('r !sudo cat ' .. opts['args'])
|
||||||
|
end, { nargs = 1 })
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- Statusbar
|
||||||
|
vim.opt.statusline = ' #%n %f %h%w%m%r %= %y %l:%c %p%% '
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- Keymaps
|
||||||
|
vim.api.nvim_set_keymap('n', '<leader>f', ':find ', { noremap = true, silent = true })
|
||||||
Reference in New Issue
Block a user