redo notes setup

This commit is contained in:
saibotk 2023-06-16 01:49:24 +02:00
parent 6769c16f20
commit 4c449f9537
Signed by: saibotk
GPG key ID: 67585F0065E261D5
4 changed files with 24 additions and 20 deletions

View file

@ -24,9 +24,6 @@ vim.keymap.set('n', '<leader>f', '<cmd>Telescope find_files<CR>')
vim.keymap.set('n', '<leader>l', '<cmd>Telescope live_grep<CR>') vim.keymap.set('n', '<leader>l', '<cmd>Telescope live_grep<CR>')
vim.keymap.set('n', '<silent> gy', '<cmd>Telescope treesitter<CR>') vim.keymap.set('n', '<silent> gy', '<cmd>Telescope treesitter<CR>')
vim.keymap.set('n', '<leader>wm', require("notes").list)
vim.keymap.set('n', '<leader>wt', require("notes").tags)
-- neo formatter -- neo formatter
vim.keymap.set('n', '<leader>p', ':Neoformat<CR>') vim.keymap.set('n', '<leader>p', ':Neoformat<CR>')

View file

@ -5,16 +5,15 @@ local sorters = require "telescope.sorters"
local conf = require("telescope.config").values local conf = require("telescope.config").values
local flatten = vim.tbl_flatten local flatten = vim.tbl_flatten
local M = {}
function M.list() local function list()
require("telescope.builtin").find_files { require("telescope.builtin").find_files {
prompt_title = "Notes", prompt_title = "Notes",
cwd = "~/.notes" cwd = "~/.notes"
} }
end end
function M.tags() local function tags()
local opts = {} local opts = {}
local vimgrep_arguments = conf.vimgrep_arguments local vimgrep_arguments = conf.vimgrep_arguments
@ -44,4 +43,19 @@ function M.tags()
}):find() }):find()
end 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', '<leader>wm', list)
vim.keymap.set('n', '<leader>wt', tags)
vim.keymap.set('n', '<leader>wn', new_note)

View file

@ -3,7 +3,6 @@
-- syntax -- syntax
vim.cmd [[ vim.cmd [[
let mapleader = " " let mapleader = " "
set shortmess+=c
colorscheme sonokai colorscheme sonokai
]] ]]
@ -12,10 +11,11 @@ vim.opt.termguicolors=true
vim.g.do_filetype_lua = 1 vim.g.do_filetype_lua = 1
-- random settings -- random settings
vim.opt.number = true vim.opt.shortmess:append('c')
vim.opt.rnu = true vim.opt.number=true
vim.opt.clipboard = 'unnamed' vim.opt.rnu=true
vim.opt.mouse = 'nvi' vim.opt.clipboard='unnamed'
vim.opt.mouse='nvi'
vim.opt.visualbell = true vim.opt.visualbell = true
vim.opt.virtualedit = 'block' vim.opt.virtualedit = 'block'

View file

@ -1,4 +1,4 @@
-- PLUGIN OPTIONS -- SETUP FO VARIOUS PLUGIN OPTIONS
-- GITGUTTER SETUP -- GITGUTTER SETUP
-- ========================= -- =========================
@ -14,15 +14,8 @@ augroup VimDiff
augroup END 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 -- VIMTEX SETUP
-- ========================= -- =========================
vim.api.nvim_set_var('vimtex_compiler_engine', 'lualatex') vim.api.nvim_set_var('vimtex_compiler_engine', 'lualatex')
vim.api.nvim_set_var('vimtex_quickfix_mode', 0) vim.api.nvim_set_var('vimtex_quickfix_mode', 0)
vim.api.nvim_set_var('tex_flavor', 'latex') vim.api.nvim_set_var('tex_flavor', 'latex')