1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

bump to nvim version 0.9.0 (#188)

This commit is contained in:
jdhao 2023-04-07 22:42:24 +02:00 committed by GitHub
parent 8746c7eb11
commit 644993a89e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 18 deletions

View File

@ -5,7 +5,7 @@ local utils = require('utils')
-- Inspect something -- Inspect something
function _G.inspect(item) function _G.inspect(item)
vim.pretty_print(item) vim.print(item)
end end
------------------------------------------------------------------------ ------------------------------------------------------------------------

View File

@ -3,10 +3,6 @@ scriptencoding utf-8
" change fillchars for folding, vertical split, end of buffer, and message separator " change fillchars for folding, vertical split, end of buffer, and message separator
set fillchars=fold:\ ,vert:\│,eob:\ ,msgsep:‾ set fillchars=fold:\ ,vert:\│,eob:\ ,msgsep:‾
" Paste mode toggle, it seems that Nvim's bracketed paste mode
" does not work very well for nvim-qt, so we use good-old paste mode
set pastetoggle=<F12>
" Split window below/right when creating horizontal/vertical windows " Split window below/right when creating horizontal/vertical windows
set splitbelow splitright set splitbelow splitright
@ -176,6 +172,7 @@ set diffopt+=filler " show filler for deleted lines
set diffopt+=closeoff " turn off diff when one file window is closed set diffopt+=closeoff " turn off diff when one file window is closed
set diffopt+=context:3 " context for diff set diffopt+=context:3 " context for diff
set diffopt+=internal,indent-heuristic,algorithm:histogram set diffopt+=internal,indent-heuristic,algorithm:histogram
set diffopt+=linematch:60
set nowrap " do no wrap set nowrap " do no wrap
set noruler set noruler

View File

@ -11,14 +11,16 @@
-- StackOverflow: https://stackoverflow.com/users/6064933/jdhao -- StackOverflow: https://stackoverflow.com/users/6064933/jdhao
local api = vim.api local api = vim.api
local utils = require("utils") local version = vim.version
-- check if we have the latest stable version of nvim -- check if we have the latest stable version of nvim
local expected_ver = "0.8.3" local expected_ver = "0.9.0"
local nvim_ver = utils.get_nvim_version() local ev = version.parse(expected_ver)
local actual_ver = version()
if nvim_ver ~= expected_ver then if version.cmp(ev, actual_ver) ~= 0 then
local msg = string.format("Unsupported nvim version: expect %s, but got %s instead!", expected_ver, nvim_ver) local _ver = string.format("%s.%s.%s", actual_ver.major, actual_ver.minor, actual_ver.patch)
local msg = string.format("Unsupported nvim version: expect %s, but got %s instead!", expected_ver, _ver)
api.nvim_err_writeln(msg) api.nvim_err_writeln(msg)
return return
end end

View File

@ -93,7 +93,7 @@ local diff = function()
local add_num = git_status.added local add_num = git_status.added
local info = { added = add_num, modified = modify_num, removed = remove_num } local info = { added = add_num, modified = modify_num, removed = remove_num }
-- vim.pretty_print(info) -- vim.print(info)
return info return info
end end

View File

@ -31,13 +31,6 @@ function M.may_create_dir(dir)
end end
end end
function M.get_nvim_version()
local actual_ver = vim.version()
local nvim_ver_str = string.format("%d.%d.%d", actual_ver.major, actual_ver.minor, actual_ver.patch)
return nvim_ver_str
end
--- Generate random integers in the range [Low, High], inclusive, --- Generate random integers in the range [Low, High], inclusive,
--- adapted from https://stackoverflow.com/a/12739441/6064933 --- adapted from https://stackoverflow.com/a/12739441/6064933
--- @low: the lower value for this range --- @low: the lower value for this range