diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua index acc83fa..9c74fe0 100644 --- a/nvim/lua/mappings.lua +++ b/nvim/lua/mappings.lua @@ -24,9 +24,6 @@ vim.keymap.set('n', 'f', 'Telescope find_files') vim.keymap.set('n', 'l', 'Telescope live_grep') vim.keymap.set('n', ' gy', 'Telescope treesitter') -vim.keymap.set('n', 'wm', require("notes").list) -vim.keymap.set('n', 'wt', require("notes").tags) - -- neo formatter vim.keymap.set('n', 'p', ':Neoformat') diff --git a/nvim/lua/notes.lua b/nvim/lua/notes.lua index 839507b..1c2be4c 100644 --- a/nvim/lua/notes.lua +++ b/nvim/lua/notes.lua @@ -5,16 +5,15 @@ local sorters = require "telescope.sorters" local conf = require("telescope.config").values local flatten = vim.tbl_flatten -local M = {} -function M.list() +local function list() require("telescope.builtin").find_files { prompt_title = "Notes", cwd = "~/.notes" } end -function M.tags() +local function tags() local opts = {} local vimgrep_arguments = conf.vimgrep_arguments @@ -44,4 +43,19 @@ function M.tags() }):find() end -return M +local function new_note() + local note_name = vim.ui.input({prompt = 'New note name: '}, function(input) + print(input) + end) +end + +-- VIMWIKI SETUP +-- ========================= +vim.api.nvim_set_var('vimwiki_list', {{path = '~/.notes/', syntax = 'markdown', ext = '.md'}}) +vim.api.nvim_set_var('vimwiki_hl_headers', 1) +vim.api.nvim_set_var('vimwiki_listsyms', ' X') + +-- KEYMAPS +vim.keymap.set('n', 'wm', list) +vim.keymap.set('n', 'wt', tags) +vim.keymap.set('n', 'wn', new_note) diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua index 9ec8969..051cfad 100644 --- a/nvim/lua/options.lua +++ b/nvim/lua/options.lua @@ -3,7 +3,6 @@ -- syntax vim.cmd [[ let mapleader = " " - set shortmess+=c colorscheme sonokai ]] @@ -12,10 +11,11 @@ vim.opt.termguicolors=true vim.g.do_filetype_lua = 1 -- random settings -vim.opt.number = true -vim.opt.rnu = true -vim.opt.clipboard = 'unnamed' -vim.opt.mouse = 'nvi' +vim.opt.shortmess:append('c') +vim.opt.number=true +vim.opt.rnu=true +vim.opt.clipboard='unnamed' +vim.opt.mouse='nvi' vim.opt.visualbell = true vim.opt.virtualedit = 'block' diff --git a/nvim/lua/pluginoptions.lua b/nvim/lua/pluginoptions.lua index 1e7c6ca..68a6ae4 100644 --- a/nvim/lua/pluginoptions.lua +++ b/nvim/lua/pluginoptions.lua @@ -1,4 +1,4 @@ --- PLUGIN OPTIONS +-- SETUP FO VARIOUS PLUGIN OPTIONS -- GITGUTTER SETUP -- ========================= @@ -14,15 +14,8 @@ augroup VimDiff augroup END ]] --- VIMWIKI SETUP --- ========================= -vim.api.nvim_set_var('vimwiki_list', {{path = '~/.notes/', syntax = 'markdown', ext = '.md'}}) -vim.api.nvim_set_var('vimwiki_hl_headers', 1) -vim.api.nvim_set_var('vimwiki_listsyms', ' X') - -- VIMTEX SETUP -- ========================= - vim.api.nvim_set_var('vimtex_compiler_engine', 'lualatex') vim.api.nvim_set_var('vimtex_quickfix_mode', 0) vim.api.nvim_set_var('tex_flavor', 'latex')