rewrote date inserter to insert at the cursor
This commit is contained in:
@@ -2383,7 +2383,9 @@ function! s:git_validate(spec, check_branch)
|
|||||||
let err = join(['Invalid URI: '.remote,
|
let err = join(['Invalid URI: '.remote,
|
||||||
\ 'Expected: '.a:spec.uri,
|
\ 'Expected: '.a:spec.uri,
|
||||||
\ 'PlugClean required.'], "\n")
|
\ 'PlugClean required.'], "\n")
|
||||||
elseif a:check_branch && has_key(a:spec, 'commit')
|
elseif !a:check_branch
|
||||||
|
return ['', 0]
|
||||||
|
elseif has_key(a:spec, 'commit')
|
||||||
let sha = s:git_revision(a:spec.dir)
|
let sha = s:git_revision(a:spec.dir)
|
||||||
if empty(sha)
|
if empty(sha)
|
||||||
let err = join(add(result, 'PlugClean required.'), "\n")
|
let err = join(add(result, 'PlugClean required.'), "\n")
|
||||||
@@ -2392,18 +2394,16 @@ function! s:git_validate(spec, check_branch)
|
|||||||
\ a:spec.commit[:6], sha[:6]),
|
\ a:spec.commit[:6], sha[:6]),
|
||||||
\ 'PlugUpdate required.'], "\n")
|
\ 'PlugUpdate required.'], "\n")
|
||||||
endif
|
endif
|
||||||
elseif a:check_branch
|
elseif has_key(a:spec, 'tag')
|
||||||
let current_branch = result[0]
|
|
||||||
" Check tag
|
|
||||||
let origin_branch = s:git_origin_branch(a:spec)
|
|
||||||
if has_key(a:spec, 'tag')
|
|
||||||
let tag = s:system_chomp('git describe --exact-match --tags HEAD 2>&1', a:spec.dir)
|
let tag = s:system_chomp('git describe --exact-match --tags HEAD 2>&1', a:spec.dir)
|
||||||
if a:spec.tag !=# tag && a:spec.tag !~ '\*'
|
if a:spec.tag !=# tag && a:spec.tag !~ '\*'
|
||||||
let err = printf('Invalid tag: %s (expected: %s). Try PlugUpdate.',
|
let err = printf('Invalid tag: %s (expected: %s). Try PlugUpdate.',
|
||||||
\ (empty(tag) ? 'N/A' : tag), a:spec.tag)
|
\ (empty(tag) ? 'N/A' : tag), a:spec.tag)
|
||||||
endif
|
endif
|
||||||
" Check branch
|
elseif a:check_branch
|
||||||
elseif origin_branch !=# current_branch
|
let current_branch = result[0]
|
||||||
|
let origin_branch = s:git_origin_branch(a:spec)
|
||||||
|
if origin_branch !=# current_branch
|
||||||
let err = printf('Invalid branch: %s (expected: %s). Try PlugUpdate.',
|
let err = printf('Invalid branch: %s (expected: %s). Try PlugUpdate.',
|
||||||
\ current_branch, origin_branch)
|
\ current_branch, origin_branch)
|
||||||
endif
|
endif
|
||||||
|
|||||||
2877
autoload/plug.vim.old
Normal file
2877
autoload/plug.vim.old
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
|||||||
|
vim.opt.wrap = true
|
||||||
vim.keymap.set({"n" , "v"} , "<leader>k" , "?=\\+ <CR>" , { desc = "MOVE UP HEADING" })
|
vim.keymap.set({"n" , "v"} , "<leader>k" , "?=\\+ <CR>" , { desc = "MOVE UP HEADING" })
|
||||||
vim.keymap.set({"n" , "v"} , "<leader>j" , "/=\\+ <CR>" , { desc = "MOVE DOWN HEADING" })
|
vim.keymap.set({"n" , "v"} , "<leader>j" , "/=\\+ <CR>" , { desc = "MOVE DOWN HEADING" })
|
||||||
vim.keymap.set({"n" , "v"} , "k" , "gk" , { desc = "MOVE UP VISUALLY" })
|
vim.keymap.set({"n" , "v"} , "k" , "gk" , { desc = "MOVE UP VISUALLY" })
|
||||||
|
|||||||
44
init.lua
44
init.lua
@@ -34,8 +34,8 @@ vim.call('plug#end')
|
|||||||
--└──────────────┘
|
--└──────────────┘
|
||||||
vim.opt.number = true
|
vim.opt.number = true
|
||||||
vim.opt.relativenumber = true
|
vim.opt.relativenumber = true
|
||||||
vim.opt.numberwidth = 4
|
vim.opt.numberwidth = 5
|
||||||
vim.opt.wrap = true
|
vim.opt.wrap = false
|
||||||
vim.opt.breakindent = true
|
vim.opt.breakindent = true
|
||||||
|
|
||||||
--┌────────┐
|
--┌────────┐
|
||||||
@@ -87,6 +87,7 @@ vim.opt.autochdir = true
|
|||||||
vim.opt.mouse = ""
|
vim.opt.mouse = ""
|
||||||
vim.opt.splitbelow = true
|
vim.opt.splitbelow = true
|
||||||
vim.opt.splitright = true
|
vim.opt.splitright = true
|
||||||
|
vim.opt.cpoptions:append("J")
|
||||||
|
|
||||||
--┌─────────────┐
|
--┌─────────────┐
|
||||||
--│ │
|
--│ │
|
||||||
@@ -102,7 +103,8 @@ vim.keymap.set({"n" , "v"} , "<leader>C" , ":put =execute('lua ="
|
|||||||
vim.keymap.set({"n" , "v"} , "<leader>E" , ":set ve=none<CR>" , { desc = "DISABLE VISUAL EDIT MODE" })
|
vim.keymap.set({"n" , "v"} , "<leader>E" , ":set ve=none<CR>" , { desc = "DISABLE VISUAL EDIT MODE" })
|
||||||
vim.keymap.set({"n" , "v"} , "<leader>b" , "ly$h%p" , { desc = "COPY CONTEXT COMMENT TO OTHER END OF SCOPE" })
|
vim.keymap.set({"n" , "v"} , "<leader>b" , "ly$h%p" , { desc = "COPY CONTEXT COMMENT TO OTHER END OF SCOPE" })
|
||||||
vim.keymap.set({"n" , "v"} , "<leader>c" , ":lua =" , { desc = "QUICK LUA CALCULATION" })
|
vim.keymap.set({"n" , "v"} , "<leader>c" , ":lua =" , { desc = "QUICK LUA CALCULATION" })
|
||||||
vim.keymap.set({"n" , "v"} , "<leader>d" , ":put =strftime('%Y-%m-%d-%H:%M:%S')<CR> :normal I[<ESC>A]<ESC>kJ" , { desc = "APPEND TIMESTAMP TO LINE" })
|
--vim.keymap.set({"n" , "v"} , "<leader>d" , ":put =strftime('%Y-%m-%d-%H:%M:%S')<CR> :normal I[<ESC>A]<ESC>kJ" , { desc = "APPEND TIMESTAMP TO LINE" })
|
||||||
|
vim.keymap.set({"n"} , "<leader>d" , function() vim.api.nvim_put({os.date('%Y-%m-%d-%H:%M:%S')},'c',true,true) end , { desc = "APPEND TIMESTAMP TO LINE" })
|
||||||
vim.keymap.set({"n" , "v"} , "<leader>e" , ":set ve=all<CR>" , { desc = "ENABLE VISUAL EDIT MODE" })
|
vim.keymap.set({"n" , "v"} , "<leader>e" , ":set ve=all<CR>" , { desc = "ENABLE VISUAL EDIT MODE" })
|
||||||
vim.keymap.set({"n" , "v"} , "<leader>o" , ":buffer<Space>" , { desc = "BUFFER MENU" })
|
vim.keymap.set({"n" , "v"} , "<leader>o" , ":buffer<Space>" , { desc = "BUFFER MENU" })
|
||||||
vim.keymap.set({"n" , "v"} , "<leader>p" , "\"*p" , { desc = "PASTE FROM CLIPBOARD" })
|
vim.keymap.set({"n" , "v"} , "<leader>p" , "\"*p" , { desc = "PASTE FROM CLIPBOARD" })
|
||||||
@@ -134,39 +136,25 @@ vim.opt.clipboard:append("unnamedplus")
|
|||||||
--│ Treesitter │
|
--│ Treesitter │
|
||||||
--│ │
|
--│ │
|
||||||
--└────────────┘
|
--└────────────┘
|
||||||
require'nvim-treesitter.configs'.setup {
|
require'nvim-treesitter'.setup{
|
||||||
-- A list of parser names, or "all" (the listed parsers MUST always be installed)
|
ensure_installed = { "bash", "c", "css", "cpp", "go", "html", "java", "javascript", "json", "lua", "markdown", "markdown_inline", "python", "rust", "tsx", "typescript" },
|
||||||
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline", "javascript", "html", "nginx", "bash", "cmake"},
|
|
||||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
|
||||||
sync_install = false,
|
|
||||||
-- Automatically install missing parsers when entering buffer
|
|
||||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
|
||||||
auto_install = false,
|
|
||||||
-- List of parsers to ignore installing (or "all")
|
|
||||||
--ignore_install = { "javascript" },
|
|
||||||
---- 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 = {
|
highlight = {
|
||||||
enable = true,
|
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,
|
|
||||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
-- 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).
|
-- 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.
|
-- 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
|
-- Instead of true it can also be a list of languages
|
||||||
additional_vim_regex_highlighting = false,
|
additional_vim_regex_highlighting = false,
|
||||||
},
|
},
|
||||||
|
-- incremental_selection = {
|
||||||
|
-- enable = true,
|
||||||
|
-- keymaps = {
|
||||||
|
-- init_selection = "gnn", -- set to `false` to disable one of the mappings
|
||||||
|
-- node_incremental = "grn",
|
||||||
|
-- scope_incremental = "grc",
|
||||||
|
-- node_decremental = "grm",
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
}
|
}
|
||||||
|
|
||||||
--┌──────────────┐
|
--┌──────────────┐
|
||||||
|
|||||||
Reference in New Issue
Block a user