parent
fb723b6f06
commit
a4f9ba5719
@ -1,6 +1,6 @@
|
||||
-- source options
|
||||
require('core')
|
||||
-- load plugins and its options
|
||||
require('pluginList')
|
||||
-- load mappings
|
||||
require('mappings')
|
||||
-- load plugins and its options
|
||||
require('plugins')
|
||||
|
@ -1,63 +0,0 @@
|
||||
-- Set barbar's options
|
||||
require'bufferline'.setup {
|
||||
-- Enable/disable animations
|
||||
animation = false,
|
||||
|
||||
-- Enable/disable auto-hiding the tab bar when there is a single buffer
|
||||
auto_hide = false,
|
||||
|
||||
-- Enable/disable current/total tabpages indicator (top right corner)
|
||||
tabpages = true,
|
||||
|
||||
-- Enable/disable close button
|
||||
closable = true,
|
||||
|
||||
-- Enables/disable clickable tabs
|
||||
-- - left-click: go to buffer
|
||||
-- - middle-click: delete buffer
|
||||
clickable = true,
|
||||
|
||||
-- Enable/disable icons
|
||||
-- if set to 'numbers', will show buffer index in the tabline
|
||||
-- if set to 'both', will show buffer index and icons in the tabline
|
||||
icons = true,
|
||||
|
||||
-- If set, the icon color will follow its corresponding buffer
|
||||
-- highlight group. By default, the Buffer*Icon group is linked to the
|
||||
-- Buffer* group (see Highlighting below). Otherwise, it will take its
|
||||
-- default value as defined by devicons.
|
||||
icon_custom_colors = true,
|
||||
|
||||
-- Configure icons on the bufferline.
|
||||
icon_separator_active = '│',
|
||||
icon_separator_inactive = '|',
|
||||
icon_close_tab = '',
|
||||
icon_close_tab_modified = '●',
|
||||
icon_pinned = '車',
|
||||
|
||||
-- If true, new buffers will be inserted at the start/end of the list.
|
||||
-- Default is to insert after current buffer.
|
||||
insert_at_end = false,
|
||||
insert_at_start = false,
|
||||
|
||||
-- Sets the maximum padding width with which to surround each tab
|
||||
maximum_padding = 1,
|
||||
|
||||
-- Sets the maximum buffer name length.
|
||||
maximum_length = 30,
|
||||
|
||||
-- If set, the letters for each buffer in buffer-pick mode will be
|
||||
-- assigned based on their name. Otherwise or in case all letters are
|
||||
-- already assigned, the behavior is to assign letters in order of
|
||||
-- usability (see order below)
|
||||
semantic_letters = true,
|
||||
|
||||
-- New buffer letters are assigned in this order. This order is
|
||||
-- optimal for the qwerty keyboard layout but might need adjustement
|
||||
-- for other layouts.
|
||||
letters = 'asdfjkl;ghnmxcvbziowerutyqpASDFJKLGHNMXCVBZIOWERUTYQP',
|
||||
|
||||
-- Sets the name of unnamed buffers. By default format is "[Buffer X]"
|
||||
-- where X is the buffer number. But only a static string is accepted here.
|
||||
no_name_title = nil
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
require("zk").setup({
|
||||
-- can be "telescope", "fzf" or "select" (`vim.ui.select`)
|
||||
-- it's recommended to use "telescope" or "fzf"
|
||||
picker = "telescope",
|
||||
|
||||
lsp = {
|
||||
-- `config` is passed to `vim.lsp.start_client(config)`
|
||||
config = {
|
||||
cmd = {"zk", "lsp"},
|
||||
name = "zk",
|
||||
root_dir = vim.loop.cwd()
|
||||
-- on_attach = ...
|
||||
-- etc, see `:h vim.lsp.start_client()`
|
||||
},
|
||||
|
||||
-- automatically attach buffers in a zk notebook that match the given filetypes
|
||||
auto_attach = {enabled = true, filetypes = {"markdown"}}
|
||||
}
|
||||
})
|
||||
|
||||
-- mappings
|
||||
-- Add the key mappings only for Markdown files in a zk notebook.
|
||||
if require("zk.util").notebook_root(vim.fn.expand('%:p')) ~= nil then
|
||||
local map = vim.api.nvim_set_keymap
|
||||
local opts = {noremap = true, silent = false}
|
||||
|
||||
-- Open the link under the caret.
|
||||
map("n", "<CR>", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
|
||||
-- Create a new note after asking for its title.
|
||||
-- This overrides the global `<leader>zn` mapping to create the note in the same directory as the current buffer.
|
||||
map("n", "<leader>zn",
|
||||
"<Cmd>ZkNew { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: ') }<CR>",
|
||||
opts)
|
||||
-- Create a new note in the same directory as the current buffer, using the current selection for title.
|
||||
map("v", "<leader>znt",
|
||||
":'<,'>ZkNewFromTitleSelection { dir = vim.fn.expand('%:p:h') }<CR>",
|
||||
opts)
|
||||
-- Create a new note in the same directory as the current buffer, using the current selection for note content and asking for its title.
|
||||
map("v", "<leader>znc",
|
||||
":'<,'>ZkNewFromContentSelection { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: ') }<CR>",
|
||||
opts)
|
||||
|
||||
-- Open notes linking to the current buffer.
|
||||
map("n", "<leader>zb", "<Cmd>ZkBacklinks<CR>", opts)
|
||||
-- Alternative for backlinks using pure LSP and showing the source context.
|
||||
-- map('n', '<leader>zb', '<Cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||
-- Open notes linked by the current buffer.
|
||||
map("n", "<leader>zl", "<Cmd>ZkLinks<CR>", opts)
|
||||
|
||||
-- Open the code actions for a visual selection.
|
||||
map("v", "<leader>za", ":'<,'>lua vim.lsp.buf.range_code_action()<CR>", opts)
|
||||
end
|
Loading…
Reference in new issue