aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2023-04-07 22:42:24 +0200
committerGitHub <noreply@github.com>2023-04-08 04:42:24 +0800
commit644993a89e8be251c10f4d2b1bb761301f4545b1 (patch)
tree5e796f10ad4ea784c8c733a439d64ec2f39f0011
parent8746c7eb11f368efb90226f8a49eec57764ba06a (diff)
bump to nvim version 0.9.0 (#188)
-rw-r--r--core/globals.lua2
-rw-r--r--core/options.vim5
-rw-r--r--init.lua12
-rw-r--r--lua/config/statusline.lua2
-rw-r--r--lua/utils.lua7
5 files changed, 10 insertions, 18 deletions
diff --git a/core/globals.lua b/core/globals.lua
index 8989c89..b0af26e 100644
--- a/core/globals.lua
+++ b/core/globals.lua
@@ -5,7 +5,7 @@ local utils = require('utils')
-- Inspect something
function _G.inspect(item)
- vim.pretty_print(item)
+ vim.print(item)
end
------------------------------------------------------------------------
diff --git a/core/options.vim b/core/options.vim
index c798165..635888a 100644
--- a/core/options.vim
+++ b/core/options.vim
@@ -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
diff --git a/init.lua b/init.lua
index 7863178..1d76d0d 100644
--- a/init.lua
+++ b/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
diff --git a/lua/config/statusline.lua b/lua/config/statusline.lua
index 1655e15..285c2a3 100644
--- a/lua/config/statusline.lua
+++ b/lua/config/statusline.lua
@@ -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
diff --git a/lua/utils.lua b/lua/utils.lua
index ab1473f..fef4178 100644
--- a/lua/utils.lua
+++ b/lua/utils.lua
@@ -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