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:
parent
8746c7eb11
commit
644993a89e
@ -5,7 +5,7 @@ local utils = require('utils')
|
||||
|
||||
-- Inspect something
|
||||
function _G.inspect(item)
|
||||
vim.pretty_print(item)
|
||||
vim.print(item)
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
@ -3,10 +3,6 @@ scriptencoding utf-8
|
||||
" change fillchars for folding, vertical split, end of buffer, and message separator
|
||||
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
|
||||
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+=context:3 " context for diff
|
||||
set diffopt+=internal,indent-heuristic,algorithm:histogram
|
||||
set diffopt+=linematch:60
|
||||
|
||||
set nowrap " do no wrap
|
||||
set noruler
|
||||
|
||||
12
init.lua
12
init.lua
@ -11,14 +11,16 @@
|
||||
-- StackOverflow: https://stackoverflow.com/users/6064933/jdhao
|
||||
|
||||
local api = vim.api
|
||||
local utils = require("utils")
|
||||
local version = vim.version
|
||||
|
||||
-- check if we have the latest stable version of nvim
|
||||
local expected_ver = "0.8.3"
|
||||
local nvim_ver = utils.get_nvim_version()
|
||||
local expected_ver = "0.9.0"
|
||||
local ev = version.parse(expected_ver)
|
||||
local actual_ver = version()
|
||||
|
||||
if nvim_ver ~= expected_ver then
|
||||
local msg = string.format("Unsupported nvim version: expect %s, but got %s instead!", expected_ver, nvim_ver)
|
||||
if version.cmp(ev, actual_ver) ~= 0 then
|
||||
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)
|
||||
return
|
||||
end
|
||||
|
||||
@ -93,7 +93,7 @@ local diff = function()
|
||||
local add_num = git_status.added
|
||||
|
||||
local info = { added = add_num, modified = modify_num, removed = remove_num }
|
||||
-- vim.pretty_print(info)
|
||||
-- vim.print(info)
|
||||
return info
|
||||
end
|
||||
|
||||
|
||||
@ -31,13 +31,6 @@ function M.may_create_dir(dir)
|
||||
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,
|
||||
--- adapted from https://stackoverflow.com/a/12739441/6064933
|
||||
--- @low: the lower value for this range
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user