add pyright and buffer code folder, markdwon use mdflow

This commit is contained in:
gameloader
2022-11-13 10:33:18 +08:00
parent e9d69cba33
commit 3eee395fbf
18 changed files with 201 additions and 76 deletions

View File

@ -15,7 +15,7 @@ db.custom_center = {
icon = "",
desc = "Find File ",
action = "Telescope find_files find_command=rg,--hidden,--files",
shortcut = " f",
shortcut = "SPC f f",
},
{
icon = "",
@ -33,6 +33,6 @@ db.custom_center = {
icon = "",
desc = "File Browser ",
action = "Telescope file_browser",
shortcut = "SPC f f",
shortcut = "SPC f b",
},
}

View File

@ -2,9 +2,10 @@ require("hop").setup({})
--- place this in one of your configuration file(s)
local hop = require("hop")
local directions = require("hop.hint").HintDirection
-- vim.keymap.set("", "f", function()
-- hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true })
-- end, { remap = true })
vim.keymap.set("", "f", function()
hop.hint_patterns({ direction = directions.AFTER_CURSOR, current_line_only = true }, "\\u")
end, { remap = true })
vim.keymap.set("", "F", function()
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true })
end, { remap = true })

View File

@ -0,0 +1,60 @@
local ls = require("luasnip")
local s = ls.snippet
local sn = ls.snippet_node
local isn = ls.indent_snippet_node
local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node
local c = ls.choice_node
local d = ls.dynamic_node
local r = ls.restore_node
local events = require("luasnip.util.events")
local ai = require("luasnip.nodes.absolute_indexer")
local extras = require("luasnip.extras")
local l = extras.lambda
local rep = extras.rep
local p = extras.partial
local m = extras.match
local n = extras.nonempty
local dl = extras.dynamic_lambda
local fmt = require("luasnip.extras.fmt").fmt
local fmta = require("luasnip.extras.fmt").fmta
local conds = require("luasnip.extras.expand_conditions")
local postfix = require("luasnip.extras.postfix").postfix
local types = require("luasnip.util.types")
local parse = require("luasnip.util.parser").parse_snippet
local date = function()
return { os.date("%Y-%m-%d") }
end
ls.add_snippets("all", {
s({
trig = "date",
name = "Date",
dscr = "Date in the form of YYYY-MM-DD",
}, {
f(date, {}),
}),
})
ls.add_snippets("markdown", {
s({ trig = "meta", name = "Metadata", dscr = "Yaml metadata format for markdown" }, {
t({ "---", "title: " }),
i(1, "note_title"),
t({ "", "author: " }),
i(2, "Logic"),
t({ "", "date: " }),
f(date, {}),
t({ "", 'categories: ["' }),
i(3, ""),
t({ '"]', "tags: [" }),
i(4),
t({ "]", "draft: " }),
i(5, "false"),
t({ "", "", "---", "" }),
i(0),
}),
})
require("luasnip.loaders.from_lua").lazy_load({ include = { "all", "markdown" } })

View File

@ -0,0 +1 @@
require("mkdnflow").setup({})

View File

@ -1,5 +1,5 @@
local let_table_settings = {}
-- local let_table_settings = {}
for k, v in pairs(let_table_settings) do
vim.g[k] = v
end
-- for k, v in pairs(let_table_settings) do
-- vim.g[k] = v
-- end

View File

@ -1,55 +1,55 @@
require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all"
ensure_installed = {},
require("nvim-treesitter.configs").setup({
-- A list of parser names, or "all"
ensure_installed = {},
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
auto_install = true,
-- Automatically install missing parsers when entering buffer
auto_install = true,
-- List of parsers to ignore installing (for "all")
-- ignore_install = { },
-- List of parsers to ignore installing (for "all")
-- ignore_install = { },
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
highlight = {
-- `false` will disable the whole extension
enable = true,
highlight = {
-- `false` will disable the whole extension
enable = true,
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
-- the name of the parser)
-- list of language that will be disabled
disable = { "c", "rust" },
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
-- the name of the parser)
-- list of language that will be disabled
-- disable = { "c", "rust" },
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
context_commentstring = {
enable = true,
enable_autocmd = false,
config = {
-- Languages that have a single comment style
typescript = "// %s",
css = "/* %s */",
scss = "/* %s */",
html = "<!-- %s -->",
svelte = "<!-- %s -->",
vue = "<!-- %s -->",
json = "",
},
},
}
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
context_commentstring = {
enable = true,
enable_autocmd = false,
config = {
-- Languages that have a single comment style
typescript = "// %s",
css = "/* %s */",
scss = "/* %s */",
html = "<!-- %s -->",
svelte = "<!-- %s -->",
vue = "<!-- %s -->",
json = "",
},
},
})