fix: update plugins and settings for neovim v0.8.0

This commit is contained in:
Dan Anglin 2022-10-06 23:21:41 +01:00
parent 9fa4d40199
commit 3d13416869
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638
6 changed files with 61 additions and 55 deletions

View file

@ -1,4 +0,0 @@
local setlocal = vim.opt_local
setlocal.spell = true
setlocal.spelllang = "en_gb"

View file

@ -1,4 +0,0 @@
local setlocal = vim.opt_local
setlocal.spell = true
setlocal.spelllang = "en_gb"

View file

@ -0,0 +1,11 @@
local ok, tokyonight = pcall(require, "tokyonight")
if not ok then
return
end
tokyonight.setup {
style = "night",
sidebars = {"packer", "terminal"},
dim_inactive = true,
}

View file

@ -1,61 +1,59 @@
local set = vim.opt
local g = vim.g
local g = vim.g
local cmd = vim.cmd
-- TODO: Use vim.fn.stdpath("state") when it is GA.
local state_directory = vim.env.XDG_STATE_HOME .. "/nvim"
local data_directory = vim.fn.stdpath("data")
local state_directory = vim.fn.stdpath("state")
g.mapleader = ","
-- State files
set.backup = true
set.backup = true
set.writebackup = true
set.backupdir = state_directory .. "/backup"
set.swapfile = true
set.directory = state_directory .. "/swap"
set.undofile = true
set.undodir = state_directory .. "/undo"
set.viewdir = state_directory .. "/view"
set.spellfile = vim.fn.stdpath("data") .. "/spell/en.utf-8.add"
set.backupdir = state_directory .. "/backup"
set.swapfile = true
set.directory = state_directory .. "/swap"
set.undofile = true
set.undodir = state_directory .. "/undo"
set.viewdir = state_directory .. "/view"
set.spellfile = data_directory .. "/spell/en.utf-8.add"
-- Searching
set.ignorecase = true -- ignore case when searching.
set.smartcase = true -- override ignorecase when upper case characters are used when searching.
set.incsearch = true -- set incremental searching.
set.smartcase = true -- override ignorecase when upper case characters are used when searching.
set.incsearch = true -- set incremental searching.
-- Default tabs and spaces
set.expandtab = true -- turn tabs into spaces
set.tabstop = 2 -- number of spaces per tab
set.softtabstop = 2 -- number of spaces per tab while editing
set.shiftwidth = 2 -- specifies the amount of whitespaces to insert/remove using indentation commands in normal mode.
set.expandtab = true -- turn tabs into spaces
set.tabstop = 2 -- number of spaces per tab
set.softtabstop = 2 -- number of spaces per tab while editing
set.shiftwidth = 2 -- specifies the amount of whitespaces to insert/remove using indentation commands in normal mode.
-- File format and encoding
set.fileformat = "unix"
set.encoding = "utf-8"
set.fileencoding = "utf-8"
set.fileformat = "unix"
set.encoding = "utf-8"
set.fileencoding = "utf-8"
set.fileencodings = "utf-8"
-- Colour scheme
set.termguicolors = true
set.background = "dark"
g.tokyonight_style = "night"
g.tokyonight_sidebars = {"packer", "terminal"}
cmd "colorscheme tokyonight"
set.background = "dark"
cmd "colorscheme tokyonight-night"
-- UI and UX
set.number = true -- enable line numbers
set.relativenumber = true -- enable releative line numbers
set.lazyredraw = true -- do not redraw screen when executing macros, registers, etc that have not been typed
set.splitright = true -- split vertical windows to the right
set.splitbelow = true -- split horizontal windows below
g.pastetoggle = "<F3>" -- Use <F3> to toggle paste/nopaste
set.confirm = true -- raise a dialogue to confirm if you wish to save a file before continuing.
set.cmdheight = 2 -- set the height of the command window to 2 lines.
set.modelines = 5 -- the first 5 lines are checked for modelines.
set.cursorline = true -- highlight the line that the cursor is on
set.smartindent = true -- smart autoidenting
set.scrolloff = 5
set.signcolumn = "number"
set.completeopt = "longest,menuone"
set.number = true -- enable line numbers
set.relativenumber = true -- enable releative line numbers
set.lazyredraw = true -- do not redraw screen when executing macros, registers, etc that have not been typed
set.splitright = true -- split vertical windows to the right
set.splitbelow = true -- split horizontal windows below
set.confirm = true -- raise a dialogue to confirm if you wish to save a file before continuing.
set.cmdheight = 2 -- set the height of the command window to 2 lines.
set.modelines = 5 -- the first 5 lines are checked for modelines.
set.cursorline = true -- highlight the line that the cursor is on
set.smartindent = true -- smart autoidenting
set.scrolloff = 5
set.signcolumn = "number"
set.completeopt = "longest,menuone"
-- Netrw settings
g.netrw_banner = 0 -- disable the banner
@ -68,7 +66,11 @@ g.netrw_keepdir = 0 -- keep the browsing directory the same as the current
-- Configure Omnifunc to use the LSP client
set.omnifunc = "v:lua.vim.lsp.omnifunc"
-- Spelling
set.spell = true
set.spelllang = "en_gb"
-- The Statusline
local statusline = require("statusline")
set.statusline = statusline.output()
set.laststatus = 3
set.statusline = statusline.output()
set.laststatus = 3

View file

@ -2,35 +2,36 @@ return require("packer").startup(function(use)
-- Packer can manage itself
use {
"wbthomason/packer.nvim",
commit = "213ed031490ab5318e7996a594b52131e5c1c06f", -- 2022-07-30
commit = "6afb67460283f0e990d35d229fd38fdc04063e0a", -- 2022-09-10
}
use {
"folke/tokyonight.nvim",
commit = "8223c970677e4d88c9b6b6d81bda23daf11062bb", -- 2021-12-31
commit = "fd9105c9487996aa2269992b72a6fea7504688e4", -- 2022-10-05
config = require("config.tokyonight"),
}
use {
"neovim/nvim-lspconfig",
commit = "60f2993b9661d9844cee3bebdbd1b5860577eb3c", -- 2022-07-29
commit = "1c2a57d991548995030748088a7ded73a7b5f496", -- 2022-10-06
config = require("config.lsp"),
}
use {
"nvim-treesitter/nvim-treesitter",
commit = "18ad3904fbf7f1a11140c97e45432d57e63b40eb", -- 2022-07-30
commit = "a33858d399d0da226b0cf7b45fe9dc8f0a06547b", -- 2022-10-06
config = require("config.treesitter"),
run = ":TSUpdate",
}
use {
"kyazdani42/nvim-web-devicons",
commit = "2d02a56189e2bde11edd4712fea16f08a6656944", -- 2022-07-05
commit = "a8cf88cbdb5c58e2b658e179c4b2aa997479b3da", -- 2022-10-03
}
use {
"akinsho/bufferline.nvim",
tag = "v2.4.0", -- 2022.07.10
tag = "v2.12.0", -- 2022.10.03
requires = "kyazdani42/nvim-web-devicons",
config = require("config.bufferline"),
}

View file

@ -45,7 +45,7 @@ local theme = require("statusline.themes.tokyonight")
local ns = vim.api.nvim_create_namespace("statusline")
function M.output()
vim.api.nvim__set_hl_ns(ns)
vim.api.nvim_set_hl_ns(ns)
for name, settings in pairs(theme.theme) do
vim.api.nvim_set_hl(ns, name, settings)