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 -- Clear trailing whitespace
vim.keymap.set("n", "<C-w>", "<cmd>let _s=@/<Bar>:%s/\\s\\+$//e<Bar>:let @/=_s<Bar><CR>") 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 on_attach = function(client, bufnr)
local utils = require('utils')
local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
-- Mappings. -- Mappings.

View file

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

View file

@ -86,6 +86,17 @@ require('packer').startup(function()
use { 'Shougo/deoplete.nvim' } use { 'Shougo/deoplete.nvim' }
use { 'beeender/Comrade' } 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) end)
require('plugins.cmp') require('plugins.cmp')

View file

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

View file

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