Skip to content

Commit

Permalink
Nvim overhaul (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson authored Sep 25, 2024
1 parent e6956d8 commit cdd73d5
Show file tree
Hide file tree
Showing 44 changed files with 573 additions and 887 deletions.
3 changes: 2 additions & 1 deletion kitty/kitty.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#: individual font faces and even specify special fonts for particular
#: characters.

font_family SF Mono Powerline
font_family SF Mono
# bold_font auto
# italic_font auto
# bold_italic_font auto
Expand Down Expand Up @@ -49,6 +49,7 @@ font_size 11.3

# symbol_map

symbol_map U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E6AA,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF,U+F0001-U+F1AF0 Symbols Nerd Font Mono
#: E.g. symbol_map U+E0A0-U+E0A3,U+E0C0-U+E0C7 PowerlineSymbols

#: Map the specified Unicode codepoints to a particular font. Useful
Expand Down
5 changes: 5 additions & 0 deletions nvim/after/ftplugin/html.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
vim.g.html_indent_inctags = "html,body,head,tbody,div"
vim.g.html_indent_script1 = "inc"
vim.b.softtabstop = 2
vim.b.shiftwidth = 2
vim.b.tabstop = 2
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions nvim/after/ftplugin/python.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
vim.api.nvim_create_autocmd("InsertCharPre", {
pattern = { "*.py" },
group = vim.api.nvim_create_augroup("py-fstring", { clear = true }),
callback = function(params)
if vim.v.char ~= "{" then return end

local node = vim.treesitter.get_node({})

if not node then return end

if node:type() ~= "string" then node = node:parent() end

if not node or node:type() ~= "string" then return end
local row, col, _, _ = vim.treesitter.get_node_range(node)
local first_char = vim.api.nvim_buf_get_text(params.buf, row, col, row, col + 1, {})[1]
if first_char == "f" then return end

vim.api.nvim_input("<Esc>m'" .. row + 1 .. "gg" .. col + 1 .. "|if<esc>`'la")
end,
})
File renamed without changes.
2 changes: 2 additions & 0 deletions nvim/after/ftplugin/rust.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- vim.g.rustfmt_autosave = 0
-- vim.g.syntastic_rust_checkers = {}
5 changes: 5 additions & 0 deletions nvim/after/ftplugin/tmux.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- vim.keymap.set("n", "<leader>s", "<Plug>(tmux_source_file)", { silent = true, noremap = true })
-- vim.keymap.set("n", "K", "<Plug>(tmux_show_man_floatwin)", { silent = true, noremap = true })
-- vim.keymap.set("n", "g!!", "<Plug>(tmux_execute_cursorline)", { silent = true, noremap = true })
-- vim.keymap.set("n", "g!", "<Plug>(tmux_execute_selection)", { silent = true, noremap = true })

File renamed without changes.
6 changes: 6 additions & 0 deletions nvim/ftdetect/vcf.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
pattern = "*.vcf",
callback = function()
vim.bo.filetype = 'vcf'
end
})
5 changes: 0 additions & 5 deletions nvim/ftplugin/html.lua

This file was deleted.

2 changes: 0 additions & 2 deletions nvim/ftplugin/rust.lua

This file was deleted.

5 changes: 0 additions & 5 deletions nvim/ftplugin/tmux.lua

This file was deleted.

57 changes: 9 additions & 48 deletions nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,51 +1,12 @@
--------------------------------------------------------------------------------
-- TODO
--------------------------------------------------------------------------------
-- light theme
-- hot reload colors
-- breaks statusline?
-- filetype autocmds
-- nvim-lsp
-- individual LSPs: js, tex
-- key mapping updates
-- set root_dir = lspconfig.util.root_pattern('.git') as global default for lsps

--------------------------------------------------------------------------------
-- bootstrap lazy.nvim
--------------------------------------------------------------------------------

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
local load = function(mod)
package.loaded[mod] = nil
require(mod)
end
vim.opt.rtp:prepend(lazypath)

--------------------------------------------------------------------------------
-- utilities
--------------------------------------------------------------------------------
-- https://oroques.dev/notes/neovim-init

require("load_plugins")

require("lsp")
require("options")
require("mappings")
require("theme")
require("utils")
require("treesitter")
load("user.settings")
load("user.commands")
load("user.mappings")
require("user.plugins")

--------------------------------------------------------------------------------
-- TeX ftplugin?
--------------------------------------------------------------------------------
-- TODO:
-- compile shortcut
-- au FileType tex let b:AutoPairs = {'(':')', '[':']', '{':'}', '"':'"', '"""':'"""'}
-- let g:surround_{char2nr('c')} = "\\\1command\1{\r}"
-- aucmd to re-enable syntax highlighting
-- must be after plugin config
pcall(vim.cmd.colorscheme, "tokyonight")
159 changes: 0 additions & 159 deletions nvim/lua/load_plugins.lua

This file was deleted.

Loading

0 comments on commit cdd73d5

Please sign in to comment.