Skip to content

Commit

Permalink
Update neovim config
Browse files Browse the repository at this point in the history
  • Loading branch information
steveno committed May 15, 2024
1 parent e40a68c commit 3738c23
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 12 deletions.
25 changes: 25 additions & 0 deletions dot_config/nvim/lua/empty_misc.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-- Any copyright is dedicated to the Public Domain.
--
-- https://creativecommons.org/publicdomain/zero/1.0/

function file_exists(file)
-- some error codes:
-- 13 : EACCES - Permission denied
-- 17 : EEXIST - File exists
-- 20 : ENOTDIR - Not a directory
-- 21 : EISDIR - Is a directory
--
local isok, errstr, errcode = os.rename(file, file)
if isok == nil then
if errcode == 13 then
-- Permission denied, but it exists
return true
end
return false
end
return true
end

function dir_exists(path)
return file_exists(path .. "/")
end
7 changes: 7 additions & 0 deletions dot_config/nvim/lua/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,16 @@ require("lazy").setup({
"jaawerth/fennel.vim",
"Olical/conjure",
"Olical/aniseed",
"neovim/nvim-lspconfig",
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"mfussenegger/nvim-dap",
"nvim-neotest/nvim-nio",
{ "rcarriga/nvim-dap-ui", requires = {"mfussenegger/nvim-dap", "nvim-neotest/nvim-nio"} },
{ "yorickpeterse/vim-paper", lazy = true },
{ "junegunn/fzf", name = "fzf", dir = "~/.fzf", build = "./install --all" },
{ "fatih/vim-go" },
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
})

------------------------------------------------------
Expand Down
28 changes: 16 additions & 12 deletions dot_config/nvim/lua/settings.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
-- Any copyright is dedicated to the Public Domain.
-- https://creativecommons.org/publicdomain/zero/1.0/

require('misc')

-- Status line is always shown
vim.opt.laststatus = 2

-- Show full tags when doing search completion
Expand Down Expand Up @@ -45,27 +48,28 @@ vim.opt.numberwidth = 3

-- Allow hidden buffers
vim.opt.hidden = true

vim.opt.termguicolors = true


-- Create backups
vim.opt.backup = true
vim.cmd([[
try
set backupdir=$HOME/.local/share/nvim/backups/
set directory=$HOME/.local/share/nvim/backups/
catch
endtry
]])
local backupdir = "/home/steveno/.local/share/nvim/backups"
if dir_exists(backupdir) then
vim.opt.backup = true
vim.opt.backupdir = backupdir
vim.opt.directory = backupdir
else
vim.print("ERROR: Failed to set backupdir to " .. backupdir)
return
end

-- color scheme
vim.opt.termguicolors = true
vim.cmd([[
let &t_8f = "\<Esc>[38:2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48:2;%lu;%lu;%lum"
set t_Co=256
colorscheme paper
]])

vim.cmd.colorscheme('paper')

-- Python
vim.g.python3_host_prog = "/usr/bin/python3"

0 comments on commit 3738c23

Please sign in to comment.