neovim config added
This commit is contained in:
parent
f0b4fd66c4
commit
25ed1c4f19
72
nvim/colors/vhs.lua
Normal file
72
nvim/colors/vhs.lua
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
local colors = {
|
||||||
|
bg = "#0A0A0A",
|
||||||
|
fg = "#C0C0C0",
|
||||||
|
borderfg = "#444444",--need to see if not shit
|
||||||
|
floatbg = "#0C0C0C",--same
|
||||||
|
separatorfg = "#262626",--same
|
||||||
|
cursorlinebg = "#111111",
|
||||||
|
visualbg = "#333333",
|
||||||
|
statuslinebg = "#1A1A1A",
|
||||||
|
linenrfg = "#505050",
|
||||||
|
cursorlinenrfg = "#FFE94D",
|
||||||
|
commentfg = "#7FAAFF",
|
||||||
|
identifierfg = "#FF4D6D",
|
||||||
|
statementfg = "#A64DFF",
|
||||||
|
functionfg = "#8EFF8E",
|
||||||
|
constantfg = "#FFE94D",
|
||||||
|
typefg = "#508DFF",
|
||||||
|
stringfg = "#66FFFF",
|
||||||
|
keywordfg = "#D888FF",
|
||||||
|
pmenubg = "#111111",
|
||||||
|
pmenufg = "#C0C0C0",
|
||||||
|
pmenuselbg = "#A64DFF",
|
||||||
|
pmenuselfg = "#0A0A0A",
|
||||||
|
}
|
||||||
|
|
||||||
|
local transparent = false
|
||||||
|
|
||||||
|
local function set_highlight(group, opts)
|
||||||
|
vim.api.nvim_set_hl(0, group, opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function apply_theme()
|
||||||
|
vim.opt.background = "dark"
|
||||||
|
vim.cmd("highlight clear")
|
||||||
|
vim.cmd("syntax reset")
|
||||||
|
vim.g.colors_name = "vhs"
|
||||||
|
|
||||||
|
local bg = transparent and "NONE" or colors.bg
|
||||||
|
local floatbg = transparent and "NONE" or colors.floatbg
|
||||||
|
local cursorlinebg = transparent and "NONE" or colors.cursorlinebg
|
||||||
|
local visualbg = transparent and "NONE" or colors.visualbg
|
||||||
|
local statuslinebg = transparent and "NONE" or colors.statuslinebg
|
||||||
|
local pmenubg = transparent and "NONE" or colors.pmenubg
|
||||||
|
local pmenuselbg = transparent and "NONE" or colors.pmenuselbg
|
||||||
|
|
||||||
|
set_highlight("Normal", { fg = colors.fg, bg = bg})
|
||||||
|
set_highlight("LineNr", { fg = colors.linenrfg, bg = bg})
|
||||||
|
set_highlight("CursorLineNr", { fg = colors.cursorlinerfg , bg = bg})
|
||||||
|
set_highlight("Comment", { fg = colors.commentfg, italic = true})
|
||||||
|
set_highlight("Identifier", { fg = colors.identifierfg})
|
||||||
|
set_highlight("Statement", { fg = colors.statementfg})
|
||||||
|
set_highlight("Function", { fg = colors.functionfg})
|
||||||
|
set_highlight("Constant", { fg = colors.constantfg})
|
||||||
|
set_highlight("Type", { fg = colors.typefg})
|
||||||
|
set_highlight("String", { fg = colors.stringfg})
|
||||||
|
set_highlight("Keyword", { fg = colors.keywordfg})
|
||||||
|
|
||||||
|
set_highlight("Pmenu", { fg = colors.pmenufg, bg = pmenubg})
|
||||||
|
set_highlight("PmenuSel", { fg = colors.pmenuselfg, bg = pmenuselbg})
|
||||||
|
|
||||||
|
set_highlight("Visual", { bg = visualbg })
|
||||||
|
set_highlight("CursorLine", { bg = cursorlinebg })
|
||||||
|
set_highlight("StatusLine", { fg = colors.functionfg, bg = statuslinebg})
|
||||||
|
|
||||||
|
set_highlight("NormalFloat", {fg = colors.fg, bg = floatbg})
|
||||||
|
set_highlight("FloatBorder", {fg = colors.borderfg, bg = floatbg})
|
||||||
|
set_highlight("WinSeparator", {fg = colors.separatorfg, bg = bg})
|
||||||
|
set_highlight("VertSplit", {fg = colors.separatorfg, bg = bg})
|
||||||
|
end
|
||||||
|
|
||||||
|
apply_theme()
|
||||||
|
|
||||||
4
nvim/init.lua
Normal file
4
nvim/init.lua
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
require('plugins')
|
||||||
|
require('options')
|
||||||
|
|
||||||
|
vim.cmd("colorscheme vhs")
|
||||||
75
nvim/lua/options.lua
Normal file
75
nvim/lua/options.lua
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
--options--
|
||||||
|
|
||||||
|
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
vim.opt.number = true
|
||||||
|
|
||||||
|
vim.opt.autoindent = false
|
||||||
|
vim.opt.tabstop = 8
|
||||||
|
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
vim.opt.wrap = false
|
||||||
|
|
||||||
|
|
||||||
|
--bindings--
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
local builtin = require('telescope.builtin')
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>ff', builtin.find_files , { desc = 'Telescope find files' })
|
||||||
|
vim.keymap.set('n', '<leader>fg', builtin.live_grep , { desc = 'Telescope live grep' })
|
||||||
|
vim.keymap.set('n', '<leader>fb', builtin.buffers , { desc = 'Telescope buffers' })
|
||||||
|
vim.keymap.set('n', '<leader>fh', builtin.help_tags , { desc = 'Telescope help tags' })
|
||||||
|
vim.keymap.set('n', '<leader>fd', function()
|
||||||
|
builtin.file_browser({ path = "%:p:h", select_buffer = true})
|
||||||
|
end, { desc = 'File browser' })
|
||||||
|
|
||||||
|
|
||||||
|
require'nvim-treesitter.configs'.setup {
|
||||||
|
ensure_installed = {"c", "vim", "vimdoc", "lua", "markdown", "css", "html", "javascript"},
|
||||||
|
sync_install = false,
|
||||||
|
auto_install = false,
|
||||||
|
|
||||||
|
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
disable = function (lang, buf)
|
||||||
|
local max_filesize = 100 * 1024
|
||||||
|
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||||
|
if ok and stats and stats.size > max_filesize then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
},
|
||||||
|
additional_vim_regex_highlighting = false,
|
||||||
|
}
|
||||||
|
|
||||||
|
local function makefile_utils()
|
||||||
|
local pickers = require('telescope.pickers')
|
||||||
|
local finders = require('telescope.finders')
|
||||||
|
local conf = require('telescope.config').values
|
||||||
|
local actions = require('telescope.actions')
|
||||||
|
local action_state = require('telescope.actions.state')
|
||||||
|
|
||||||
|
local make_targets = vim.fn.systemlist("awk -F':' '/^[a-zA-Z0-9][^$#\\t=]*:([^=]|$)/ {print $1}' Makefile | sort -u")
|
||||||
|
|
||||||
|
pickers.new({}, {
|
||||||
|
prompt_title = "Make Targets",
|
||||||
|
finder = finders.new_table { result = make_targets },
|
||||||
|
sorter = conf.generic_sorter({}),
|
||||||
|
atatch_mappings = function(prompt_bufnr)
|
||||||
|
actions.select_default:replace(function()
|
||||||
|
local selection = action_state.get_selected_entry()
|
||||||
|
actions.close(prompt_bufnr)
|
||||||
|
vim.cmd("split | terminal make" .. selection [1])
|
||||||
|
end)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
}):find()
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>fm', makefile_utils, { desc = 'Makefile targets' })
|
||||||
|
vim.keymap.set('n', '<leader>s', ':w<CR>', { desc = 'Save file' })
|
||||||
|
|
||||||
12
nvim/lua/plugins.lua
Normal file
12
nvim/lua/plugins.lua
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
local vim = vim
|
||||||
|
local Plug = vim.fn['plug#']
|
||||||
|
|
||||||
|
vim.call('plug#begin')
|
||||||
|
|
||||||
|
|
||||||
|
Plug('nvim-lua/plenary.nvim')
|
||||||
|
Plug('nvim-treesitter/nvim-treesitter', { ['do'] = ':TSUpdate' })
|
||||||
|
Plug('nvim-telescope/telescope.nvim', { ['branch'] = '0.1.x' })
|
||||||
|
Plug('nvim-telescope/telescope-fzf-native.nvim', { ['do'] = 'make' })
|
||||||
|
|
||||||
|
vim.call('plug#end')
|
||||||
Loading…
x
Reference in New Issue
Block a user