remove utils module

This commit is contained in:
Vladan Popovic 2024-08-12 16:10:35 +02:00
parent b3b051355a
commit 5c8e114e44
7 changed files with 35 additions and 45 deletions

View file

@ -1,5 +1,3 @@
local utils = require('utils')
-- Clear trailing whitespace
vim.keymap.set("n", "<C-w>", "<cmd>let _s=@/<Bar>:%s/\\s\\+$//e<Bar>:let @/=_s<Bar><CR>")

View file

@ -1,5 +1,4 @@
local on_attach = function(client, bufnr)
local utils = require('utils')
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
-- Mappings.

View file

@ -1,8 +1,6 @@
-- Completion plugin config
local utils = require('utils')
utils.opt('o', 'completeopt', 'menuone,noselect')
vim.opt.completeopt = 'menuone,noselect'
local cmp = require('cmp')
local cmp_kinds = {

View file

@ -86,6 +86,17 @@ require('packer').startup(function()
use { 'Shougo/deoplete.nvim' }
use { 'beeender/Comrade' }
use({
'MeanderingProgrammer/render-markdown.nvim',
after = { 'nvim-treesitter' },
requires = { 'echasnovski/mini.nvim', opt = true }, -- if you use the mini.nvim suite
-- requires = { 'echasnovski/mini.icons', opt = true }, -- if you use standalone mini plugins
-- requires = { 'nvim-tree/nvim-web-devicons', opt = true }, -- if you prefer nvim-web-devicons
config = function()
require('render-markdown').setup({})
end,
})
end)
require('plugins.cmp')

View file

@ -94,7 +94,7 @@ require('oil').setup({
if not dir then
return false
end
return vim.list_contains(git_ignored[dir], name)
-- return vim.list_contains(git_ignored[dir], name)
end,
-- This function defines what will never be shown, even when `show_hidden` is set
is_always_hidden = function(name, bufnr)

View file

@ -1,44 +1,38 @@
local utils = require('utils')
local indent = 4
vim.cmd 'syntax enable'
vim.cmd 'filetype plugin indent on'
--
-- Highlight on yank
vim.cmd 'au TextYankPost * lua vim.highlight.on_yank {on_visual = false}'
utils.opt('b', 'expandtab', true)
utils.opt('b', 'shiftwidth', indent)
utils.opt('b', 'tabstop', indent)
utils.opt('b', 'softtabstop', indent)
utils.opt('b', 'smartindent', true)
utils.opt('o', 'hidden', true)
utils.opt('o', 'ignorecase', true)
utils.opt('o', 'scrolloff', 4)
utils.opt('o', 'shiftround', true)
utils.opt('o', 'smartcase', true)
utils.opt('o', 'splitbelow', true)
utils.opt('o', 'splitright', true)
utils.opt('o', 'wildmode', 'list:longest')
utils.opt('w', 'number', true)
utils.opt('o', 'clipboard', 'unnamed,unnamedplus')
utils.opt('o', 'mouse', 'a')
vim.opt.shiftwidth = indent
vim.opt.tabstop = indent
vim.opt.softtabstop = indent
vim.opt.scrolloff = indent
vim.opt.wildmode = 'list:longest,list:full'
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.hidden = true
vim.opt.ignorecase = true
vim.opt.shiftround = true
vim.opt.smartcase = true
vim.opt.splitbelow = true
vim.opt.splitright = true
vim.opt.number = true
vim.opt.autoindent = false
vim.opt.smartindent = false
vim.opt.background = 'light'
vim.opt.errorformat:prepend('%f|%l col %c|%m')
vim.opt.fileformat = 'unix'
vim.opt.undofile = true
vim.opt.background = 'light'
-- Enable vimrc files per project and disable unsafe commands in project vimrc
vim.opt.exrc = true
vim.opt.secure = true
-- unknown filetypes mappings
vim.cmd([[
autocmd BufRead,BufNewFile *.bu set filetype=yaml
autocmd BufRead,BufNewFile *.yml.example set filetype=yaml
autocmd BufRead,BufNewFile *.yaml.example set filetype=yaml
syntax enable
filetype plugin indent on
set noautoread
autocmd CursorHold * checktime
autocmd TextYankPost * lua vim.highlight.on_yank {on_visual = false}
autocmd BufRead,BufNewFile *.bu,*.yml.example,*.yaml.example set filetype=yaml
autocmd BufRead,BufNewFile *.ign set filetype=json
]])

View file

@ -1,10 +0,0 @@
local utils = {}
local scopes = { o = vim.o, b = vim.bo, w = vim.wo }
function utils.opt(scope, key, value)
scopes[scope][key] = value
if scope ~= 'o' then scopes['o'][key] = value end
end
return utils