diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua index 5f2c6b2..3bd8801 100644 --- a/nvim/lua/mappings.lua +++ b/nvim/lua/mappings.lua @@ -1,41 +1,38 @@ -local map = require("utils").map -- search for visual selection -map {'v', '//', 'y/"'} -map {'n', 'H', '^'} +vim.keymap.set('v', '//', 'y/"') +vim.keymap.set('n', 'H', '^') + -- ex command -map {'c', '', ''} -map {'c', '', ''} +vim.keymap.set('c', '', '') +vim.keymap.set('c', '', '') -- auto expand brackets -map {'i', '(;', '()O'} -map {'i', '(,', '(),O'} -map {'i', '{;', '{}O'} -map {'i', '{,', '{},O'} -map {'i', '[;', '[]O'} -map {'i', '[,', '[],O'} +vim.keymap.set('i', '(;', '()O') +vim.keymap.set('i', '(,', '(),O') +vim.keymap.set('i', '{;', '{}O') +vim.keymap.set('i', '{,', '{},O') +vim.keymap.set('i', '[;', '[]O') +vim.keymap.set('i', '[,', '[],O') -- toggle hybrid mode -map {'n', 'h', ':set rnu!'} +vim.keymap.set('n', 'h', ':set rnu!') -- nvim-tree.lua -map {'n', 'e', ':NvimTreeToggle'} +vim.keymap.set('n', 'e', ':NvimTreeToggle') -- Telescope -map {'n', '', 'Telescope buffers'} -map {'n', 'f', 'Telescope find_files'} -map {'n', 'l', 'Telescope live_grep'} -map {'n', ' gy', 'Telescope treesitter'} +vim.keymap.set('n', '', 'Telescope buffers') +vim.keymap.set('n', 'f', 'Telescope find_files') +vim.keymap.set('n', 'l', 'Telescope live_grep') +vim.keymap.set('n', ' gy', 'Telescope treesitter') -map {'n', 'wm', 'lua require("notes").list()'} -map {'n', 'wt', 'lua require("notes").tags()'} +vim.keymap.set('n', 'wm', require("notes").list) +vim.keymap.set('n', 'wt', require("notes").tags) -- neo formatter -map {'n', 'p', ':Neoformat'} - --- goyo mapping -map {'n', ' w', ':Goyo'} +vim.keymap.set('n', 'p', ':Neoformat') -- spelling -map {'n', ' se', ':set spell spelllang=en'} -map {'n', ' sd', ':set spell spelllang=de'} +vim.keymap.set('n', ' se', ':set spell spelllang=en') +vim.keymap.set('n', ' sd', ':set spell spelllang=de') diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua index ca5543e..9ec8969 100644 --- a/nvim/lua/options.lua +++ b/nvim/lua/options.lua @@ -2,15 +2,14 @@ -- syntax vim.cmd [[ - syntax on - let mapleader=" " - colorscheme sonokai - hi MatchParen guibg=NONE guifg=red gui=bold + let mapleader = " " set shortmess+=c + colorscheme sonokai ]] -- color settings -vim.opt.termguicolors = true +vim.opt.termguicolors=true +vim.g.do_filetype_lua = 1 -- random settings vim.opt.number = true diff --git a/nvim/lua/pluginoptions.lua b/nvim/lua/pluginoptions.lua index 08a33c9..6cbed9d 100644 --- a/nvim/lua/pluginoptions.lua +++ b/nvim/lua/pluginoptions.lua @@ -1,6 +1,5 @@ -- PLUGIN OPTIONS - -- GITGUTTER SETUP -- ========================= vim.api.nvim_set_var('gitgutter_sign_added', '∙') diff --git a/nvim/lua/utils.lua b/nvim/lua/utils.lua deleted file mode 100644 index 080a58a..0000000 --- a/nvim/lua/utils.lua +++ /dev/null @@ -1,21 +0,0 @@ - -local M = {} -function M.map(key) - -- get the extra options - local opts = {noremap = true} - for i, v in pairs(key) do - if type(i) == 'string' then opts[i] = v end - end - - -- basic support for buffer-scoped keybindings - local buffer = opts.buffer - opts.buffer = nil - - if buffer then - vim.api.nvim_buf_set_keymap(0, key[1], key[2], key[3], opts) - else - vim.api.nvim_set_keymap(key[1], key[2], key[3], opts) - end -end - -return M