Switch to Lua based nvim config
This commit is contained in:
parent
57807cb5c2
commit
e892669b83
573
nvim/init.lua
Normal file
573
nvim/init.lua
Normal file
@ -0,0 +1,573 @@
|
||||
-- Install packer
|
||||
local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
|
||||
local is_bootstrap = false
|
||||
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
||||
is_bootstrap = true
|
||||
vim.fn.system { 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
end
|
||||
|
||||
require('packer').startup(function(use)
|
||||
-- Package manager
|
||||
use 'wbthomason/packer.nvim'
|
||||
|
||||
use { -- LSP Configuration & Plugins
|
||||
'neovim/nvim-lspconfig',
|
||||
requires = {
|
||||
-- Automatically install LSPs to stdpath for neovim
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
|
||||
-- Useful status updates for LSP
|
||||
'j-hui/fidget.nvim',
|
||||
|
||||
-- Additional lua configuration, makes nvim stuff amazing
|
||||
'folke/neodev.nvim',
|
||||
},
|
||||
}
|
||||
|
||||
use { -- Autocompletion
|
||||
'hrsh7th/nvim-cmp',
|
||||
requires = {
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'L3MON4D3/LuaSnip',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
'hrsh7th/cmp-buffer', -- Buffer completion
|
||||
'hrsh7th/cmp-path', -- File path completion
|
||||
'hrsh7th/cmp-nvim-lua', -- Lua completion
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
use { -- Highlight, edit, and navigate code
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = function()
|
||||
pcall(require('nvim-treesitter.install').update { with_sync = true })
|
||||
end,
|
||||
}
|
||||
|
||||
use { -- Additional text objects via treesitter
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
after = 'nvim-treesitter',
|
||||
}
|
||||
|
||||
-- Git related plugins
|
||||
use 'tpope/vim-fugitive'
|
||||
use 'tpope/vim-rhubarb'
|
||||
use 'lewis6991/gitsigns.nvim'
|
||||
|
||||
-- use 'navariau/onedark.nvim' -- Theme inspired by Atom
|
||||
use 'sainnhe/edge' -- Colorscheme
|
||||
use 'nvim-lualine/lualine.nvim' -- Fancier statusline
|
||||
use 'lukas-reineke/indent-blankline.nvim' -- Add indentation guides even on blank lines
|
||||
use 'numToStr/Comment.nvim' -- "gc" to comment visual regions/lines
|
||||
use 'tpope/vim-sleuth' -- Detect tabstop and shiftwidth automatically
|
||||
|
||||
-- Fuzzy Finder (files, lsp, etc)
|
||||
use { 'nvim-telescope/telescope.nvim', branch = '0.1.x', requires = { 'nvim-lua/plenary.nvim' } }
|
||||
|
||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built. Only load if `make` is available
|
||||
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make', cond = vim.fn.executable 'make' == 1 }
|
||||
|
||||
use 'scrooloose/nerdtree'
|
||||
use 'jistr/vim-nerdtree-tabs'
|
||||
use 'Xuyuanp/nerdtree-git-plugin'
|
||||
use 'ryanoasis/vim-devicons'
|
||||
|
||||
-- Easy window resize
|
||||
use 'roxma/vim-window-resize-easy'
|
||||
|
||||
-- Session Management
|
||||
use 'tpope/vim-obsession'
|
||||
|
||||
use 'maxbrunsfeld/vim-yankstack'
|
||||
use 'ntpeters/vim-better-whitespace'
|
||||
use 'github/copilot.vim'
|
||||
use 'majutsushi/tagbar'
|
||||
|
||||
-- Parens
|
||||
use 'jiangmiao/auto-pairs'
|
||||
use 'tpope/vim-surround'
|
||||
|
||||
-- Todo comment highlight + diagnostics + navigation
|
||||
use {
|
||||
"folke/todo-comments.nvim",
|
||||
requires = "nvim-lua/plenary.nvim",
|
||||
}
|
||||
|
||||
-- Smart Buffer management
|
||||
use {
|
||||
'akinsho/bufferline.nvim',
|
||||
tag = "v3.*",
|
||||
requires = 'nvim-tree/nvim-web-devicons',
|
||||
}
|
||||
use 'johann2357/nvim-smartbufs'
|
||||
|
||||
-- Latex preview
|
||||
use 'xuhdev/vim-latex-live-preview'
|
||||
|
||||
-- DevOps Quatsch
|
||||
use 'cespare/vim-toml'
|
||||
use 'mrk21/yaml-vim'
|
||||
use 'hashivim/vim-terraform'
|
||||
use 'pedrohdz/vim-yaml-folds'
|
||||
|
||||
-- Add custom plugins to packer from ~/.config/nvim/lua/custom/plugins.lua
|
||||
local has_plugins, plugins = pcall(require, 'custom.plugins')
|
||||
if has_plugins then
|
||||
plugins(use)
|
||||
end
|
||||
|
||||
if is_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
end)
|
||||
-- When we are bootstrapping a configuration, it doesn't
|
||||
-- make sense to execute the rest of the init.lua.
|
||||
--
|
||||
-- You'll need to restart nvim, and then it will work.
|
||||
if is_bootstrap then
|
||||
print '=================================='
|
||||
print ' Plugins are being installed'
|
||||
print ' Wait until Packer completes,'
|
||||
print ' then restart nvim'
|
||||
print '=================================='
|
||||
return
|
||||
end
|
||||
|
||||
-- Automatically source and re-compile packer whenever you save this init.lua
|
||||
local packer_group = vim.api.nvim_create_augroup('Packer', { clear = true })
|
||||
vim.api.nvim_create_autocmd('BufWritePost', {
|
||||
command = 'source <afile> | silent! LspStop | silent! LspStart | PackerCompile',
|
||||
group = packer_group,
|
||||
pattern = vim.fn.expand '$MYVIMRC',
|
||||
})
|
||||
|
||||
-- [[ Setting options ]]
|
||||
-- See `:help vim.o`
|
||||
|
||||
-- Set highlight on search
|
||||
vim.o.hlsearch = false
|
||||
|
||||
-- Make line numbers default
|
||||
vim.wo.number = true
|
||||
|
||||
-- Enable mouse mode
|
||||
vim.o.mouse = 'nv'
|
||||
|
||||
-- Enable break indent
|
||||
vim.o.breakindent = true
|
||||
|
||||
-- Save undo history
|
||||
vim.o.undofile = true
|
||||
|
||||
vim.o.relativenumber = true
|
||||
vim.o.encoding = 'utf-8'
|
||||
vim.o.expandtab = true
|
||||
vim.o.splitbelow = true
|
||||
vim.o.splitright = true
|
||||
|
||||
-- Case insensitive searching UNLESS /C or capital in search
|
||||
vim.o.ignorecase = true
|
||||
vim.o.smartcase = true
|
||||
|
||||
-- Decrease update time
|
||||
vim.o.updatetime = 250
|
||||
vim.wo.signcolumn = 'yes'
|
||||
|
||||
-- Set colorscheme
|
||||
vim.o.termguicolors = true
|
||||
vim.cmd [[
|
||||
if exists("$LIGHTMODE")
|
||||
set bg=light
|
||||
let g:edge_style = 'light'
|
||||
else
|
||||
set bg=dark
|
||||
let g:edge_style = 'neon'
|
||||
endif
|
||||
let g:edge_better_performance = 1
|
||||
colorscheme edge
|
||||
]]
|
||||
|
||||
-- Set completeopt to have a better completion experience
|
||||
vim.o.completeopt = 'menuone,noselect'
|
||||
|
||||
-- [[ Basic Keymaps ]]
|
||||
-- Set <space> as the leader key
|
||||
-- See `:help mapleader`
|
||||
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
|
||||
-- Keymaps for better default experience
|
||||
-- See `:help vim.keymap.set()`
|
||||
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
||||
|
||||
-- Remap for dealing with word wrap
|
||||
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
|
||||
-- [[ Highlight on yank ]]
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
group = highlight_group,
|
||||
pattern = '*',
|
||||
})
|
||||
|
||||
-- Set lualine as statusline
|
||||
-- See `:help lualine.txt`
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = false,
|
||||
theme = 'onedark',
|
||||
component_separators = '|',
|
||||
section_separators = '',
|
||||
},
|
||||
}
|
||||
|
||||
require("bufferline").setup {}
|
||||
|
||||
-- Enable Comment.nvim
|
||||
require('Comment').setup()
|
||||
|
||||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
||||
-- See `:help indent_blankline.txt`
|
||||
require('indent_blankline').setup {
|
||||
char = '┊',
|
||||
show_trailing_blankline_indent = false,
|
||||
}
|
||||
|
||||
-- Gitsigns
|
||||
-- See `:help gitsigns.txt`
|
||||
require('gitsigns').setup {
|
||||
signs = {
|
||||
add = { text = '+' },
|
||||
change = { text = '~' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
},
|
||||
}
|
||||
|
||||
-- [[ Configure Telescope ]]
|
||||
-- See `:help telescope` and `:help telescope.setup()`
|
||||
require('telescope').setup {
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
['<C-u>'] = false,
|
||||
['<C-d>'] = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Enable telescope fzf native, if installed
|
||||
pcall(require('telescope').load_extension, 'fzf')
|
||||
|
||||
-- See `:help telescope.builtin`
|
||||
vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' })
|
||||
vim.keymap.set('n', '<leader><space>', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' })
|
||||
vim.keymap.set('n', '<leader>/', function()
|
||||
-- You can pass additional configuration to telescope to change theme, layout, etc.
|
||||
require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
})
|
||||
end, { desc = '[/] Fuzzily search in current buffer]' })
|
||||
|
||||
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
|
||||
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' })
|
||||
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' })
|
||||
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
|
||||
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
|
||||
vim.keymap.set('n', '<leader>sk', require('telescope.builtin').keymaps, { desc = '[S]earch [K]eymaps' })
|
||||
vim.keymap.set('n', '<leader>sb', require('telescope.builtin').buffers, { desc = '[S]earch [B]uffers' })
|
||||
vim.keymap.set('n', '<leader>st', "<ESC>:TodoTelescope keywords=TODO,FIXME<CR>", { desc = '[S]earch [T]odos' })
|
||||
|
||||
|
||||
-- [[ Configure Treesitter ]]
|
||||
-- See `:help nvim-treesitter`
|
||||
require('nvim-treesitter.configs').setup {
|
||||
-- Add languages to be installed here that you want installed for treesitter
|
||||
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'typescript', 'help', 'vim', 'latex', 'bibtex' },
|
||||
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true, disable = { 'python' } },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = '<c-space>',
|
||||
node_incremental = '<c-space>',
|
||||
scope_incremental = '<c-s>',
|
||||
node_decremental = '<c-backspace>',
|
||||
},
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
['aa'] = '@parameter.outer',
|
||||
['ia'] = '@parameter.inner',
|
||||
['af'] = '@function.outer',
|
||||
['if'] = '@function.inner',
|
||||
['ac'] = '@class.outer',
|
||||
['ic'] = '@class.inner',
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
[']m'] = '@function.outer',
|
||||
[']]'] = '@class.outer',
|
||||
},
|
||||
goto_next_end = {
|
||||
[']M'] = '@function.outer',
|
||||
[']['] = '@class.outer',
|
||||
},
|
||||
goto_previous_start = {
|
||||
['[m'] = '@function.outer',
|
||||
['[['] = '@class.outer',
|
||||
},
|
||||
goto_previous_end = {
|
||||
['[M'] = '@function.outer',
|
||||
['[]'] = '@class.outer',
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
['<leader>a'] = '@parameter.inner',
|
||||
},
|
||||
swap_previous = {
|
||||
['<leader>A'] = '@parameter.inner',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
require("todo-comments").setup {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
}
|
||||
|
||||
local nmap = function(keys, func, desc)
|
||||
if desc then
|
||||
desc = 'LSP: ' .. desc
|
||||
end
|
||||
|
||||
vim.keymap.set('n', keys, func, { desc = desc })
|
||||
end
|
||||
|
||||
-- Diagnostic keymaps
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
||||
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
|
||||
|
||||
-- Old bindings TODO: Refactor
|
||||
|
||||
vim.keymap.set('n', '<F2>', '<ESC>:NERDTreeToggle<CR>')
|
||||
vim.keymap.set('n', '<F4>', '<ESC>:TagbarToggle<CR>')
|
||||
|
||||
-- On Save run whitespace
|
||||
|
||||
vim.api.nvim_create_autocmd('BufEnter', {
|
||||
pattern = "*[^(.rmd|.snippets)]",
|
||||
command = "EnableStripWhitespaceOnSave"
|
||||
})
|
||||
vim.api.nvim_create_autocmd('BufEnter', {
|
||||
pattern = "*.snippets",
|
||||
command = "DisableStripWhitespaceOnSave"
|
||||
})
|
||||
|
||||
-- Yankstack
|
||||
vim.g.yankstack_map_keys = 0
|
||||
vim.keymap.set('n', '<S-P>', '<Plug>yankstack_substitute_newer_paste')
|
||||
vim.keymap.set('n', '<C-P>', '<Plug>yankstack_substitute_older_paste')
|
||||
|
||||
-- copilot
|
||||
|
||||
vim.cmd[[
|
||||
imap <silent><script><expr> <a-cr> copilot#Accept("\<CR>")
|
||||
let g:copilot_no_tab_map = v:true
|
||||
highlight CopilotSuggestion guifg=#FFAF5F ctermfg=8
|
||||
]]
|
||||
|
||||
-- Window movement
|
||||
vim.keymap.set('n', '<C-h>', '<C-w>h')
|
||||
vim.keymap.set('n', '<C-j>', '<C-w>j')
|
||||
vim.keymap.set('n', '<C-k>', '<C-w>k')
|
||||
vim.keymap.set('n', '<C-l>', '<C-w>l')
|
||||
|
||||
nmap('<Leader>1', function() require("nvim-smartbufs").goto_buffer(1) end, "Go to buffer 1")
|
||||
nmap('<Leader>2', function() require("nvim-smartbufs").goto_buffer(2) end, "Go to buffer 2")
|
||||
nmap('<Leader>3', function() require("nvim-smartbufs").goto_buffer(3) end, "Go to buffer 3")
|
||||
nmap('<Leader>4', function() require("nvim-smartbufs").goto_buffer(4) end, "Go to buffer 4")
|
||||
nmap('<Leader>5', function() require("nvim-smartbufs").goto_buffer(5) end, "Go to buffer 5")
|
||||
nmap('<Leader>6', function() require("nvim-smartbufs").goto_buffer(6) end, "Go to buffer 6")
|
||||
nmap('<Leader>7', function() require("nvim-smartbufs").goto_buffer(7) end, "Go to buffer 7")
|
||||
nmap('<Leader>8', function() require("nvim-smartbufs").goto_buffer(8) end, "Go to buffer 8")
|
||||
nmap('<Leader>9', function() require("nvim-smartbufs").goto_buffer(9) end, "Go to buffer 9")
|
||||
|
||||
-- " Improved :bnext :bprev behavior (without considering terminal buffers)
|
||||
nmap('<Right>', require("nvim-smartbufs").goto_next_buffer, 'Go to next buffer')
|
||||
nmap('<Left>', require("nvim-smartbufs").goto_prev_buffer, 'Go to previous buffer')
|
||||
|
||||
-- " Delete current buffer and goes back to the previous one
|
||||
nmap('<Leader>qb', require("nvim-smartbufs").close_current_buffer, 'Close current buffer')
|
||||
|
||||
|
||||
-- LSP settings.
|
||||
-- This function gets run when an LSP connects to a particular buffer.
|
||||
local on_attach = function(_, bufnr)
|
||||
-- NOTE: Remember that lua is a real programming language, and as such it is possible
|
||||
-- to define small helper and utility functions so you don't have to repeat yourself
|
||||
-- many times.
|
||||
--
|
||||
-- In this case, we create a function that lets us more easily define mappings specific
|
||||
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
||||
local nmap = function(keys, func, desc)
|
||||
if desc then
|
||||
desc = 'LSP: ' .. desc
|
||||
end
|
||||
|
||||
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
|
||||
end
|
||||
|
||||
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
||||
|
||||
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
|
||||
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||
nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
|
||||
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
|
||||
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||
|
||||
-- See `:help K` for why this keymap
|
||||
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
|
||||
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
|
||||
|
||||
-- Lesser used LSP functionality
|
||||
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
|
||||
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
|
||||
nmap('<leader>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, '[W]orkspace [L]ist Folders')
|
||||
|
||||
-- Create a command `:Format` local to the LSP buffer
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
||||
vim.lsp.buf.format()
|
||||
end, { desc = 'Format current buffer with LSP' })
|
||||
end
|
||||
|
||||
-- Enable the following language servers
|
||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
||||
--
|
||||
-- Add any additional override configuration in the following tables. They will be passed to
|
||||
-- the `settings` field of the server config. You must look up that documentation yourself.
|
||||
local servers = {
|
||||
-- clangd = {},
|
||||
-- gopls = {},
|
||||
pyright = {},
|
||||
rust_analyzer = {},
|
||||
texlab = {}, -- latex
|
||||
-- tsserver = {},
|
||||
|
||||
sumneko_lua = {
|
||||
Lua = {
|
||||
workspace = { checkThirdParty = false },
|
||||
telemetry = { enable = false },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Setup neovim lua configuration
|
||||
require('neodev').setup()
|
||||
--
|
||||
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
|
||||
-- Setup mason so it can manage external tooling
|
||||
require('mason').setup()
|
||||
|
||||
-- Ensure the servers above are installed
|
||||
local mason_lspconfig = require 'mason-lspconfig'
|
||||
|
||||
mason_lspconfig.setup {
|
||||
ensure_installed = vim.tbl_keys(servers),
|
||||
}
|
||||
|
||||
mason_lspconfig.setup_handlers {
|
||||
function(server_name)
|
||||
require('lspconfig')[server_name].setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = servers[server_name],
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
-- Turn on lsp status information
|
||||
require('fidget').setup()
|
||||
|
||||
-- nvim-cmp setup
|
||||
local cmp = require 'cmp'
|
||||
local luasnip = require 'luasnip'
|
||||
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
},
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'buffer' },
|
||||
{ name = 'path' },
|
||||
{ name = 'nvim_lua' },
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
114
vim/.vimrc
114
vim/.vimrc
@ -1,114 +0,0 @@
|
||||
|
||||
" Make sure plug.vim is present
|
||||
if empty(glob('~/.vim/autoload/plug.vim'))
|
||||
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
|
||||
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
source ~/.vim/autoload/plug.vim
|
||||
autocmd VimEnter * PlugInstall --sync
|
||||
endif
|
||||
|
||||
" Plugin Manager
|
||||
source ~/.vim/config/plugins.vim
|
||||
|
||||
" Prepare central backup/swap/undo directory
|
||||
let &undodir = expand('~/.vim/.undo//')
|
||||
let &backupdir = expand('~/.vim/.backup//')
|
||||
let &directory = expand('~/.vim/.swp//')
|
||||
|
||||
syntax on
|
||||
filetype plugin on
|
||||
filetype plugin indent on
|
||||
|
||||
set encoding=utf-8
|
||||
" set signcolumn=number
|
||||
|
||||
set mouse=n
|
||||
|
||||
set foldmethod=syntax
|
||||
|
||||
" if exists('+termguicolors')
|
||||
" let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
|
||||
" let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
|
||||
" set termguicolors
|
||||
" endif
|
||||
|
||||
" Use whitespace instead of tab
|
||||
set expandtab
|
||||
|
||||
" Make a tabulator equal 4 spaces
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
|
||||
" Enable persistent undo
|
||||
set undofile
|
||||
|
||||
" Use relative line numbers
|
||||
set number
|
||||
set relativenumber
|
||||
|
||||
" Set linelength indicator to 120 characters
|
||||
set cc=120
|
||||
|
||||
" Natural window splitting
|
||||
set splitbelow
|
||||
set splitright
|
||||
|
||||
" Set colors
|
||||
if (has("nvim"))
|
||||
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
|
||||
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
|
||||
endif
|
||||
if (has("termguicolors"))
|
||||
set termguicolors
|
||||
endif
|
||||
|
||||
if exists("$LIGHTMODE")
|
||||
set bg=light
|
||||
let g:edge_style = 'light'
|
||||
else
|
||||
let g:edge_style = 'aura'
|
||||
endif
|
||||
let g:edge_better_performance = 1
|
||||
|
||||
colorscheme edge
|
||||
|
||||
" Turn on the Wild menu
|
||||
set wildmenu
|
||||
set wildmode=list:longest
|
||||
|
||||
|
||||
"
|
||||
set updatetime=300
|
||||
|
||||
" Ignore compiled files
|
||||
set wildignore=*.o,*~,*.pyc
|
||||
if has("win16") || has("win32")
|
||||
set wildignore+=.git\*,.hg\*,.svn\*
|
||||
else
|
||||
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
|
||||
endif
|
||||
|
||||
" No annoying sound on errors
|
||||
set noerrorbells
|
||||
set novisualbell
|
||||
set t_vb=
|
||||
set tm=500
|
||||
let mapleader=","
|
||||
|
||||
" Apply plugin configurations
|
||||
source ~/.vim/config/pluginconfig.vim
|
||||
|
||||
" Apply custom keybindings
|
||||
source ~/.vim/config/keybindings.vim
|
||||
|
||||
" Apply settings for custom filetypes
|
||||
source ~/.vim/config/filetypes.vim
|
||||
|
||||
" Transparency
|
||||
" hi Normal guibg=NONE ctermbg=NONE
|
||||
|
||||
" Prevent accidental writes to buffers that shouldn't be edited
|
||||
autocmd BufRead *.orig set readonly
|
||||
autocmd BufRead *.pacnew set readonly
|
||||
set nofoldenable
|
||||
|
@ -1,31 +0,0 @@
|
||||
{
|
||||
"languageserver": {
|
||||
"ccls": {
|
||||
"command": "ccls",
|
||||
"filetypes": ["c", "cpp", "cuda", "objc", "objcpp"],
|
||||
"rootPatterns": [".ccls-root", "compile_commands.json"],
|
||||
"initializationOptions": {
|
||||
"cache": {
|
||||
"directory": ".ccls-cache"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"git.addedSign.hlGroup": "GitGutterAdd",
|
||||
"git.changedSign.hlGroup": "GitGutterChange",
|
||||
"git.removedSign.hlGroup": "GitGutterDelete",
|
||||
"git.topRemovedSign.hlGroup": "GitGutterDelete",
|
||||
"git.changeRemovedSign.hlGroup": "GitGutterChangeDelete",
|
||||
"git.addGBlameToVirtualText": false,
|
||||
"gitignore.enable": true,
|
||||
"diagnostic.errorSign": "✘",
|
||||
"diagnostic.warningSign": "⚠",
|
||||
"diagnostic.infoSign": "ⓘ",
|
||||
"diagnostic.hintSign": "ℹ",
|
||||
"diagnostic.showUnused": true,
|
||||
"ltex.languageToolHttpServerUri": "http://localhost:8081/",
|
||||
"coc.source.vimtex.filetypes": [
|
||||
"tex"
|
||||
],
|
||||
"snippets.ultisnips.pythonPrompt": false
|
||||
}
|
@ -1,361 +0,0 @@
|
||||
" # Happy Hacking
|
||||
"
|
||||
" Happy Hacking is a color scheme heavily inspired by Autumn
|
||||
" (https://github.com/yorickpeterse/autumn.vim). The main differences between
|
||||
" the two themes are various small tweaks to the colors, an easier to maintain
|
||||
" codebase and a much wider range of supported languages. On top of that
|
||||
" various inconsistencies that were present in Autumn have been resolved.
|
||||
"
|
||||
" As with any Vim color scheme the overall look and feel heavily depends on how
|
||||
" accurate a syntax highlighter for a language is. For example, the Ruby syntax
|
||||
" highlighter is fairly accurate and allows you to customize a lot whereas for
|
||||
" example C has a more generic highlighting setup. At worst this will result in
|
||||
" a bit more heavy use of red as it's one of the base colors of this theme.
|
||||
"
|
||||
" Author: Yorick Peterse
|
||||
" License: MIT
|
||||
" Website: https://github.com/yorickpeterse/happy_hacking.vim
|
||||
"
|
||||
|
||||
set background=dark
|
||||
set t_Co=256
|
||||
|
||||
hi clear
|
||||
|
||||
if exists("syntax_on")
|
||||
syntax reset
|
||||
end
|
||||
|
||||
let colors_name = "happy_hacking"
|
||||
|
||||
" ============================================================================
|
||||
" GUI Colors
|
||||
"
|
||||
" This section defines all the colors to use when running Vim as a GUI (Gvim,
|
||||
" Macvim, etc). These colors are *not* used when Vim is run in a terminal.
|
||||
|
||||
let s:white = "#F3F2CC"
|
||||
let s:black1 = "#000000"
|
||||
let s:black2 = "#202020"
|
||||
let s:yellow = "#FAD566"
|
||||
let s:blue = "#81A2C7"
|
||||
let s:green = "#8daf67"
|
||||
let s:turqoise = "#B3EBBF"
|
||||
let s:orange = "#FAA166"
|
||||
let s:pink = "#F77EBD"
|
||||
let s:red = "#F05E48"
|
||||
let s:gray1 = "#292929"
|
||||
let s:gray2 = "#525252"
|
||||
let s:gray3 = "#6c6c6c"
|
||||
let s:gray4 = "#7c7c7c"
|
||||
let s:gray5 = "#aaaaaa"
|
||||
let s:gray6 = "#393939"
|
||||
|
||||
" ============================================================================
|
||||
" Terminal Colors
|
||||
"
|
||||
" This section defines all the colors that are used when Vim is run inside a
|
||||
" terminal instead of a GUI.
|
||||
|
||||
let s:t_white = "230"
|
||||
let s:t_black1 = "16"
|
||||
let s:t_black2 = "16"
|
||||
let s:t_yellow = "221"
|
||||
let s:t_blue = "103"
|
||||
let s:t_green = "107"
|
||||
let s:t_turqoise = "157"
|
||||
let s:t_orange = "179"
|
||||
let s:t_pink = "211"
|
||||
let s:t_gold = "186"
|
||||
let s:t_red = "203"
|
||||
let s:t_gray1 = "235"
|
||||
let s:t_gray2 = "59"
|
||||
let s:t_gray3 = "59"
|
||||
let s:t_gray4 = "102"
|
||||
let s:t_gray5 = "145"
|
||||
let s:t_gray6 = "237"
|
||||
|
||||
" ============================================================================
|
||||
" Color Functions
|
||||
|
||||
" Function for creating a highlight group with a GUI/Terminal foreground and
|
||||
" background. No font styling is applied.
|
||||
function! s:Color(group, fg, bg, t_fg, t_bg, ...)
|
||||
if empty(a:0)
|
||||
let style = "NONE"
|
||||
else
|
||||
let style = a:1
|
||||
end
|
||||
|
||||
exe "hi " . a:group . " guifg=" . a:fg . " guibg=" . a:bg
|
||||
\ . " ctermfg=" . a:t_fg
|
||||
\ . " ctermbg=" . a:t_bg
|
||||
\ . " gui=" . style
|
||||
\ . " cterm=" . style
|
||||
endfunction
|
||||
|
||||
" ============================================================================
|
||||
" General Syntax Elements
|
||||
"
|
||||
" Definitions for generic syntax elements such as strings and numbers.
|
||||
|
||||
call s:Color("Pmenu", s:white, s:black2, s:t_white, s:t_gray6)
|
||||
" Modified Pmenu! original white black2 t_white t_black
|
||||
" ~rad4day
|
||||
call s:Color("PmenuSel", s:white, s:gray2, s:t_white, s:t_gray2)
|
||||
call s:Color("Cursor", "NONE", s:gray2, "NONE", s:t_gray2)
|
||||
call s:Color("Normal", s:white, s:gray1, s:t_white, s:t_gray1)
|
||||
call s:Color("Search", s:yellow, "NONE", s:t_yellow, "NONE", "bold")
|
||||
call s:Color("Title", s:white, "NONE", s:t_white, "NONE", "bold")
|
||||
|
||||
call s:Color("LineNr", s:gray3, "NONE", s:t_gray3, "NONE")
|
||||
call s:Color("StatusLine", s:white, s:gray6, s:t_white, s:t_gray6)
|
||||
call s:Color("StatusLineNC", s:gray4, s:gray6, s:t_gray4, s:t_gray6)
|
||||
call s:Color("VertSplit", s:gray3, "NONE", s:t_gray3, "NONE")
|
||||
call s:Color("ColorColumn", "NONE", s:gray6, "NONE", s:t_gray6)
|
||||
|
||||
call s:Color("Folded", s:gray4, "NONE", s:t_gray4, "NONE")
|
||||
call s:Color("FoldColumn", s:gray3, s:gray1, s:t_gray3, s:t_gray1)
|
||||
call s:Color("ErrorMsg", s:red, "NONE", s:t_red, "NONE", "bold")
|
||||
call s:Color("WarningMsg", s:yellow, "NONE", s:t_yellow, "NONE", "bold")
|
||||
call s:Color("Question", s:white, "NONE", s:t_white, "NONE")
|
||||
|
||||
call s:Color("SpecialKey", s:white, s:gray2, s:t_white, s:t_gray2)
|
||||
call s:Color("Directory", s:blue, "NONE", s:t_blue, "NONE")
|
||||
|
||||
call s:Color("Comment", s:gray4, "NONE", s:t_gray4, "NONE")
|
||||
call s:Color("Todo", s:gray5, "NONE", s:t_gray5, "NONE")
|
||||
call s:Color("String", s:green, "NONE", s:t_green, "NONE")
|
||||
call s:Color("Keyword", s:red, "NONE", s:t_red, "NONE")
|
||||
call s:Color("Number", s:turqoise, "NONE", s:t_turqoise, "NONE")
|
||||
call s:Color("Regexp", s:orange, "NONE", s:t_orange, "NONE")
|
||||
call s:Color("Macro", s:orange, "NONE", s:t_orange, "NONE")
|
||||
call s:Color("Function", s:yellow, "NONE", s:t_yellow, "NONE")
|
||||
call s:Color("Notice", s:yellow, "NONE", s:t_yellow, "NONE")
|
||||
|
||||
call s:Color("MatchParen", "NONE", "NONE", "NONE", "NONE", "bold")
|
||||
|
||||
hi! link CursorLine Cursor
|
||||
hi! link Identifier Normal
|
||||
hi! link Constant Normal
|
||||
hi! link Operator Normal
|
||||
hi! link Type Keyword
|
||||
hi! link Statement Keyword
|
||||
hi! link PmenuThumb PmenuSel
|
||||
hi! link Visual Cursor
|
||||
hi! link SignColumn FoldColumn
|
||||
hi! link Error ErrorMsg
|
||||
hi! link NonText LineNr
|
||||
hi! link PreProc Normal
|
||||
hi! link Special Normal
|
||||
hi! link Boolean Keyword
|
||||
hi! link StorageClass Keyword
|
||||
hi! link MoreMsg Normal
|
||||
hi! link Character String
|
||||
hi! link Label Special
|
||||
hi! link PreCondit Macro
|
||||
|
||||
" ============================================================================
|
||||
" Specific Languages
|
||||
"
|
||||
" Language specific settings that would otherwise be too generic. These
|
||||
" definitions are sorted in alphabetical order.
|
||||
|
||||
" Coffeescript
|
||||
hi! link coffeeRegex Regexp
|
||||
hi! link coffeeSpecialIdent Directory
|
||||
|
||||
" CSS
|
||||
hi! link cssIdentifier Title
|
||||
hi! link cssClassName Directory
|
||||
hi! link cssMedia Notice
|
||||
hi! link cssColor Number
|
||||
hi! link cssTagName Normal
|
||||
hi! link cssImportant Notice
|
||||
|
||||
" CtrlP
|
||||
hi! link CtrlPBufferHid Todo
|
||||
hi! link CtrlPBufferPath Todo
|
||||
|
||||
call s:Color("CtrlPMode1", s:white, s:gray1, s:t_white, s:t_gray1, "bold")
|
||||
|
||||
" D
|
||||
hi! link dDebug Notice
|
||||
hi! link dOperator Operator
|
||||
hi! link dStorageClass Keyword
|
||||
hi! link dAnnotation Directory
|
||||
hi! link dAttribute dAnnotation
|
||||
|
||||
" Diffs
|
||||
hi! link diffFile WarningMsg
|
||||
hi! link diffLine Number
|
||||
hi! link diffAdded String
|
||||
hi! link diffRemoved Keyword
|
||||
|
||||
hi! link DiffChange Notice
|
||||
hi! link DiffAdd diffAdded
|
||||
hi! link DiffDelete diffRemoved
|
||||
hi! link DiffText diffLine
|
||||
|
||||
" Dot (GraphViz)
|
||||
hi! link dotKeyChar Normal
|
||||
|
||||
" Git commits
|
||||
hi! link gitCommitSummary String
|
||||
hi! link gitCommitOverflow ErrorMsg
|
||||
|
||||
" HAML
|
||||
hi! link hamlId Title
|
||||
hi! link hamlClass Directory
|
||||
hi! link htmlArg Normal
|
||||
hi! link hamlDocType Comment
|
||||
|
||||
" HTML
|
||||
hi! link htmlLink Directory
|
||||
hi! link htmlSpecialTagName htmlTag
|
||||
hi! link htmlTagName htmlTag
|
||||
hi! link htmlScriptTag htmlTag
|
||||
|
||||
" Javascript
|
||||
hi! link javaScriptBraces Normal
|
||||
hi! link javaScriptMember Normal
|
||||
hi! link javaScriptIdentifier Keyword
|
||||
hi! link javaScriptFunction Keyword
|
||||
hi! link JavaScriptNumber Number
|
||||
|
||||
" Java
|
||||
hi! link javaCommentTitle javaComment
|
||||
hi! link javaDocTags Todo
|
||||
hi! link javaDocParam Todo
|
||||
hi! link javaStorageClass Keyword
|
||||
hi! link javaAnnotation Directory
|
||||
hi! link javaExternal Keyword
|
||||
|
||||
" JSON
|
||||
hi! link jsonKeyword String
|
||||
|
||||
" Less
|
||||
hi! link lessClass cssClassName
|
||||
|
||||
" Make
|
||||
hi! link makeTarget Function
|
||||
|
||||
" Markdown
|
||||
hi! link markdownCodeBlock Todo
|
||||
hi! link markdownCode markdownCodeBlock
|
||||
hi! link markdownListMarker Keyword
|
||||
hi! link markdownOrderedListMarker Keyword
|
||||
|
||||
" NERDTree
|
||||
hi! link NERDTreeRO Notice
|
||||
hi! link NERDTreeCWD Title
|
||||
hi! link NERDTreeLink Number
|
||||
hi! link NERDTreeDir Directory
|
||||
hi! link NERDTreeOpenable NERDTreeDir
|
||||
hi! link NERDTreeClosable NERDTreeDir
|
||||
|
||||
" Perl
|
||||
hi! link podCommand Comment
|
||||
hi! link podCmdText Todo
|
||||
hi! link podVerbatimLine Todo
|
||||
hi! link perlStatementInclude Statement
|
||||
hi! link perlStatementPackage Statement
|
||||
hi! link perlPackageDecl Normal
|
||||
|
||||
" Ragel
|
||||
hi! link rlAugmentOps Operator
|
||||
|
||||
" Ruby
|
||||
hi! link rubySymbol Regexp
|
||||
hi! link rubyConstant Constant
|
||||
hi! link rubyInstanceVariable Directory
|
||||
hi! link rubyClassVariable rubyInstancevariable
|
||||
hi! link rubyClass Keyword
|
||||
hi! link rubyModule rubyClass
|
||||
hi! link rubyFunction Function
|
||||
hi! link rubyDefine Keyword
|
||||
hi! link rubyRegexp Regexp
|
||||
hi! link rubyRegexpSpecial Regexp
|
||||
hi! link rubyRegexpCharClass Normal
|
||||
hi! link rubyRegexpQuantifier Normal
|
||||
|
||||
" Rust
|
||||
hi! link rustFuncCall Identifier
|
||||
hi! link rustCommentBlockDoc Comment
|
||||
hi! link rustCommentLineDoc Comment
|
||||
|
||||
" SASS
|
||||
hi! link sassClass cssClassName
|
||||
hi! link sassId cssIdentifier
|
||||
hi! link sassInclude cssMedia
|
||||
|
||||
" Shell
|
||||
hi! link shFunctionKey Keyword
|
||||
hi! link shTestOpr Operator
|
||||
hi! link bashStatement Normal
|
||||
|
||||
" SQL
|
||||
hi! link sqlKeyword Keyword
|
||||
|
||||
" TypeScript
|
||||
hi! link typescriptBraces Normal
|
||||
hi! link typescriptEndColons Normal
|
||||
hi! link typescriptFunction Function
|
||||
hi! link typescriptFuncKeyword Keyword
|
||||
hi! link typescriptLogicSymbols Operator
|
||||
hi! link typescriptIdentifier Keyword
|
||||
hi! link typescriptExceptions Keyword
|
||||
|
||||
" Vimscript
|
||||
hi! link vimGroup Constant
|
||||
hi! link vimHiGroup Constant
|
||||
hi! link VimIsCommand Constant
|
||||
hi! link VimCommentTitle Todo
|
||||
|
||||
" YAML
|
||||
hi! link yamlPlainScalar String
|
||||
|
||||
" YARD
|
||||
hi! link yardType Todo
|
||||
hi! link yardTypeList Todo
|
||||
hi! link yardComment Comment
|
||||
|
||||
" XML
|
||||
hi! link xmlTagName Normal
|
||||
hi! link xmlTag Normal
|
||||
hi! link xmlAttrib Normal
|
||||
|
||||
" Neomake
|
||||
hi! link NeomakeWarningSign WarningMsg
|
||||
hi! link NeomakeErrorSign Error
|
||||
hi! link NeomakeWarning WarningMsg
|
||||
|
||||
" Wild menu completion
|
||||
hi! link WildMenu PmenuSel
|
||||
|
||||
" Vim tabline
|
||||
hi! link TabLine StatusLine
|
||||
hi! link TabLineFill StatusLine
|
||||
|
||||
call s:Color("TabLineSel", s:white, s:gray2, s:t_white, s:t_gray2, "bold")
|
||||
|
||||
" Line numbers
|
||||
call s:Color("CursorLineNR", s:red, "NONE", s:t_red, "NONE", "bold")
|
||||
|
||||
" Neovim terminal colors
|
||||
let g:terminal_color_0 = s:black1
|
||||
let g:terminal_color_1 = s:red
|
||||
let g:terminal_color_2 = s:green
|
||||
let g:terminal_color_3 = s:yellow
|
||||
let g:terminal_color_4 = s:blue
|
||||
let g:terminal_color_5 = s:pink
|
||||
let g:terminal_color_6 = s:turqoise
|
||||
let g:terminal_color_7 = s:white
|
||||
let g:terminal_color_8 = s:black1
|
||||
let g:terminal_color_9 = s:red
|
||||
let g:terminal_color_10 = s:green
|
||||
let g:terminal_color_11 = s:yellow
|
||||
let g:terminal_color_12 = s:blue
|
||||
let g:terminal_color_13 = s:pink
|
||||
let g:terminal_color_14 = s:turqoise
|
||||
let g:terminal_color_15 = s:white
|
@ -1,687 +0,0 @@
|
||||
" Vim color file
|
||||
"
|
||||
" " __ _ _ _ "
|
||||
" " \ \ ___| | |_ _| |__ ___ __ _ _ __ ___ "
|
||||
" " \ \/ _ \ | | | | | _ \ / _ \/ _ | _ \/ __| "
|
||||
" " /\_/ / __/ | | |_| | |_| | __/ |_| | | | \__ \ "
|
||||
" " \___/ \___|_|_|\__ |____/ \___|\____|_| |_|___/ "
|
||||
" " \___/ "
|
||||
"
|
||||
" "A colorful, dark color scheme for Vim."
|
||||
"
|
||||
" File: jellybeans.vim
|
||||
" URL: github.com/nanotech/jellybeans.vim
|
||||
" Scripts URL: vim.org/scripts/script.php?script_id=2555
|
||||
" Maintainer: NanoTech (nanotech.nanotechcorp.net)
|
||||
" Version: 1.6
|
||||
" Last Change: October 18th, 2016
|
||||
" License: MIT
|
||||
" Contributors: Andrew Wong (w0ng)
|
||||
" Brian Marshall (bmars)
|
||||
" Daniel Herbert (pocketninja)
|
||||
" David Liang <bmdavll at gmail dot com>
|
||||
" Henry So, Jr. <henryso@panix.com>
|
||||
" Joe Doherty (docapotamus)
|
||||
" Karl Litterfeldt (Litterfeldt)
|
||||
" Keith Pitt (keithpitt)
|
||||
" Philipp Rustemeier (12foo)
|
||||
" Rafael Bicalho (rbika)
|
||||
" Rich Healey (richo)
|
||||
" Siwen Yu (yusiwen)
|
||||
" Tim Willis (willist)
|
||||
"
|
||||
" Copyright (c) 2009-2016 NanoTech
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any per‐
|
||||
" son obtaining a copy of this software and associated doc‐
|
||||
" umentation files (the “Software”), to deal in the Soft‐
|
||||
" ware without restriction, including without limitation
|
||||
" the rights to use, copy, modify, merge, publish, distrib‐
|
||||
" ute, sublicense, and/or sell copies of the Software, and
|
||||
" to permit persons to whom the Software is furnished to do
|
||||
" so, subject to the following conditions:
|
||||
"
|
||||
" The above copyright notice and this permission notice
|
||||
" shall be included in all copies or substantial portions
|
||||
" of the Software.
|
||||
"
|
||||
" THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY
|
||||
" KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
" THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICU‐
|
||||
" LAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON‐
|
||||
" TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON‐
|
||||
" NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
" THE SOFTWARE.
|
||||
|
||||
set background=dark
|
||||
|
||||
hi clear
|
||||
|
||||
if exists("syntax_on")
|
||||
syntax reset
|
||||
endif
|
||||
|
||||
let colors_name = "jellybeans"
|
||||
|
||||
if has("gui_running") || (has('termguicolors') && &termguicolors) || &t_Co >= 88
|
||||
let s:low_color = 0
|
||||
else
|
||||
let s:low_color = 1
|
||||
endif
|
||||
|
||||
" Configuration Variables:
|
||||
" - g:jellybeans_overrides (default = {})
|
||||
" - g:jellybeans_use_lowcolor_black (default = 1)
|
||||
" - g:jellybeans_use_gui_italics (default = 1)
|
||||
" - g:jellybeans_use_term_italics (default = 0)
|
||||
|
||||
let s:background_color = "151515"
|
||||
|
||||
if exists("g:jellybeans_overrides")
|
||||
let s:overrides = g:jellybeans_overrides
|
||||
else
|
||||
let s:overrides = {}
|
||||
endif
|
||||
|
||||
" Backwards compatibility
|
||||
if exists("g:jellybeans_background_color")
|
||||
\ || exists("g:jellybeans_background_color_256")
|
||||
\ || exists("g:jellybeans_use_term_background_color")
|
||||
|
||||
let s:overrides = deepcopy(s:overrides)
|
||||
|
||||
if !has_key(s:overrides, "background")
|
||||
let s:overrides["background"] = {}
|
||||
endif
|
||||
|
||||
if exists("g:jellybeans_background_color")
|
||||
let s:overrides["background"]["guibg"] = g:jellybeans_background_color
|
||||
endif
|
||||
|
||||
if exists("g:jellybeans_background_color_256")
|
||||
let s:overrides["background"]["256ctermbg"] = g:jellybeans_background_color_256
|
||||
endif
|
||||
|
||||
if exists("g:jellybeans_use_term_background_color")
|
||||
\ && g:jellybeans_use_term_background_color
|
||||
let s:overrides["background"]["ctermbg"] = "NONE"
|
||||
let s:overrides["background"]["256ctermbg"] = "NONE"
|
||||
endif
|
||||
endif
|
||||
|
||||
if !exists("g:jellybeans_use_lowcolor_black") || g:jellybeans_use_lowcolor_black
|
||||
let s:termBlack = "Black"
|
||||
else
|
||||
let s:termBlack = "Grey"
|
||||
endif
|
||||
|
||||
" When `termguicolors` is set, Vim[^1] ignores `guibg=NONE` after
|
||||
" `guibg` is already set to a color. See:
|
||||
"
|
||||
" - https://github.com/vim/vim/issues/981
|
||||
" - https://github.com/nanotech/jellybeans.vim/issues/64
|
||||
"
|
||||
" To work around this, ensure we don't set the default background
|
||||
" color before an override changes it to `NONE` by ensuring that the
|
||||
" background color isn't set to a value different from its override.
|
||||
"
|
||||
" [^1]: Tested on 8.0.567. Does not apply to Neovim.
|
||||
"
|
||||
" TODO: Enable this behavior for all highlights by applying
|
||||
" overrides before calling highlight commands.
|
||||
"
|
||||
if has_key(s:overrides, "background") && has_key(s:overrides["background"], "guibg")
|
||||
let s:background_color = s:overrides["background"]["guibg"]
|
||||
endif
|
||||
|
||||
" Color approximation functions by Henry So, Jr. and David Liang {{{
|
||||
" Added to jellybeans.vim by Daniel Herbert
|
||||
|
||||
" returns an approximate grey index for the given grey level
|
||||
fun! s:grey_number(x)
|
||||
if &t_Co == 88
|
||||
if a:x < 23
|
||||
return 0
|
||||
elseif a:x < 69
|
||||
return 1
|
||||
elseif a:x < 103
|
||||
return 2
|
||||
elseif a:x < 127
|
||||
return 3
|
||||
elseif a:x < 150
|
||||
return 4
|
||||
elseif a:x < 173
|
||||
return 5
|
||||
elseif a:x < 196
|
||||
return 6
|
||||
elseif a:x < 219
|
||||
return 7
|
||||
elseif a:x < 243
|
||||
return 8
|
||||
else
|
||||
return 9
|
||||
endif
|
||||
else
|
||||
if a:x < 14
|
||||
return 0
|
||||
else
|
||||
let l:n = (a:x - 8) / 10
|
||||
let l:m = (a:x - 8) % 10
|
||||
if l:m < 5
|
||||
return l:n
|
||||
else
|
||||
return l:n + 1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns the actual grey level represented by the grey index
|
||||
fun! s:grey_level(n)
|
||||
if &t_Co == 88
|
||||
if a:n == 0
|
||||
return 0
|
||||
elseif a:n == 1
|
||||
return 46
|
||||
elseif a:n == 2
|
||||
return 92
|
||||
elseif a:n == 3
|
||||
return 115
|
||||
elseif a:n == 4
|
||||
return 139
|
||||
elseif a:n == 5
|
||||
return 162
|
||||
elseif a:n == 6
|
||||
return 185
|
||||
elseif a:n == 7
|
||||
return 208
|
||||
elseif a:n == 8
|
||||
return 231
|
||||
else
|
||||
return 255
|
||||
endif
|
||||
else
|
||||
if a:n == 0
|
||||
return 0
|
||||
else
|
||||
return 8 + (a:n * 10)
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns the palette index for the given grey index
|
||||
fun! s:grey_color(n)
|
||||
if &t_Co == 88
|
||||
if a:n == 0
|
||||
return 16
|
||||
elseif a:n == 9
|
||||
return 79
|
||||
else
|
||||
return 79 + a:n
|
||||
endif
|
||||
else
|
||||
if a:n == 0
|
||||
return 16
|
||||
elseif a:n == 25
|
||||
return 231
|
||||
else
|
||||
return 231 + a:n
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns an approximate color index for the given color level
|
||||
fun! s:rgb_number(x)
|
||||
if &t_Co == 88
|
||||
if a:x < 69
|
||||
return 0
|
||||
elseif a:x < 172
|
||||
return 1
|
||||
elseif a:x < 230
|
||||
return 2
|
||||
else
|
||||
return 3
|
||||
endif
|
||||
else
|
||||
if a:x < 75
|
||||
return 0
|
||||
else
|
||||
let l:n = (a:x - 55) / 40
|
||||
let l:m = (a:x - 55) % 40
|
||||
if l:m < 20
|
||||
return l:n
|
||||
else
|
||||
return l:n + 1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns the actual color level for the given color index
|
||||
fun! s:rgb_level(n)
|
||||
if &t_Co == 88
|
||||
if a:n == 0
|
||||
return 0
|
||||
elseif a:n == 1
|
||||
return 139
|
||||
elseif a:n == 2
|
||||
return 205
|
||||
else
|
||||
return 255
|
||||
endif
|
||||
else
|
||||
if a:n == 0
|
||||
return 0
|
||||
else
|
||||
return 55 + (a:n * 40)
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns the palette index for the given R/G/B color indices
|
||||
fun! s:rgb_color(x, y, z)
|
||||
if &t_Co == 88
|
||||
return 16 + (a:x * 16) + (a:y * 4) + a:z
|
||||
else
|
||||
return 16 + (a:x * 36) + (a:y * 6) + a:z
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns the palette index to approximate the given R/G/B color levels
|
||||
fun! s:color(r, g, b)
|
||||
" map greys directly (see xterm's 256colres.pl)
|
||||
if &t_Co == 256 && a:r == a:g && a:g == a:b && a:r > 3 && a:r < 243
|
||||
return (a:r - 8) / 10 + 232
|
||||
endif
|
||||
|
||||
" get the closest grey
|
||||
let l:gx = s:grey_number(a:r)
|
||||
let l:gy = s:grey_number(a:g)
|
||||
let l:gz = s:grey_number(a:b)
|
||||
|
||||
" get the closest color
|
||||
let l:x = s:rgb_number(a:r)
|
||||
let l:y = s:rgb_number(a:g)
|
||||
let l:z = s:rgb_number(a:b)
|
||||
|
||||
if l:gx == l:gy && l:gy == l:gz
|
||||
" there are two possibilities
|
||||
let l:dgr = s:grey_level(l:gx) - a:r
|
||||
let l:dgg = s:grey_level(l:gy) - a:g
|
||||
let l:dgb = s:grey_level(l:gz) - a:b
|
||||
let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb)
|
||||
let l:dr = s:rgb_level(l:gx) - a:r
|
||||
let l:dg = s:rgb_level(l:gy) - a:g
|
||||
let l:db = s:rgb_level(l:gz) - a:b
|
||||
let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db)
|
||||
if l:dgrey < l:drgb
|
||||
" use the grey
|
||||
return s:grey_color(l:gx)
|
||||
else
|
||||
" use the color
|
||||
return s:rgb_color(l:x, l:y, l:z)
|
||||
endif
|
||||
else
|
||||
" only one possibility
|
||||
return s:rgb_color(l:x, l:y, l:z)
|
||||
endif
|
||||
endfun
|
||||
|
||||
fun! s:is_empty_or_none(str)
|
||||
return empty(a:str) || a:str ==? "NONE"
|
||||
endfun
|
||||
|
||||
" returns the palette index to approximate the 'rrggbb' hex string
|
||||
fun! s:rgb(rgb)
|
||||
if s:is_empty_or_none(a:rgb)
|
||||
return "NONE"
|
||||
endif
|
||||
let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0
|
||||
let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0
|
||||
let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0
|
||||
return s:color(l:r, l:g, l:b)
|
||||
endfun
|
||||
|
||||
fun! s:prefix_highlight_value_with(prefix, color)
|
||||
if s:is_empty_or_none(a:color)
|
||||
return "NONE"
|
||||
else
|
||||
return a:prefix . a:color
|
||||
endif
|
||||
endfun
|
||||
|
||||
fun! s:remove_italic_attr(attr)
|
||||
let l:attr = join(filter(split(a:attr, ","), "v:val !=? 'italic'"), ",")
|
||||
if empty(l:attr)
|
||||
let l:attr = "NONE"
|
||||
endif
|
||||
return l:attr
|
||||
endfun
|
||||
|
||||
" sets the highlighting for the given group
|
||||
fun! s:X(group, fg, bg, attr, lcfg, lcbg)
|
||||
if s:low_color
|
||||
exec "hi ".a:group.
|
||||
\ " ctermfg=".s:prefix_highlight_value_with("", a:lcfg).
|
||||
\ " ctermbg=".s:prefix_highlight_value_with("", a:lcbg)
|
||||
else
|
||||
exec "hi ".a:group.
|
||||
\ " guifg=".s:prefix_highlight_value_with("#", a:fg).
|
||||
\ " guibg=".s:prefix_highlight_value_with("#", a:bg).
|
||||
\ " ctermfg=".s:rgb(a:fg).
|
||||
\ " ctermbg=".s:rgb(a:bg)
|
||||
endif
|
||||
|
||||
let l:attr = s:prefix_highlight_value_with("", a:attr)
|
||||
|
||||
if exists("g:jellybeans_use_term_italics") && g:jellybeans_use_term_italics
|
||||
let l:cterm_attr = l:attr
|
||||
else
|
||||
let l:cterm_attr = s:remove_italic_attr(l:attr)
|
||||
endif
|
||||
|
||||
if !exists("g:jellybeans_use_gui_italics") || g:jellybeans_use_gui_italics
|
||||
let l:gui_attr = l:attr
|
||||
else
|
||||
let l:gui_attr = s:remove_italic_attr(l:attr)
|
||||
endif
|
||||
|
||||
exec "hi ".a:group." gui=".l:gui_attr." cterm=".l:cterm_attr
|
||||
endfun
|
||||
" }}}
|
||||
|
||||
call s:X("Normal","e8e8d3",s:background_color,"","White","")
|
||||
set background=dark
|
||||
|
||||
if version >= 700
|
||||
call s:X("CursorLine","","1c1c1c","","",s:termBlack)
|
||||
call s:X("CursorColumn","","1c1c1c","","",s:termBlack)
|
||||
call s:X("MatchParen","ffffff","556779","bold","","DarkCyan")
|
||||
|
||||
call s:X("TabLine","000000","b0b8c0","italic","",s:termBlack)
|
||||
call s:X("TabLineFill","9098a0","","","",s:termBlack)
|
||||
call s:X("TabLineSel","000000","f0f0f0","italic,bold",s:termBlack,"White")
|
||||
|
||||
" Auto-completion
|
||||
call s:X("Pmenu","ffffff","606060","","White",s:termBlack)
|
||||
call s:X("PmenuSel","101010","eeeeee","",s:termBlack,"White")
|
||||
endif
|
||||
|
||||
call s:X("Visual","","404040","","",s:termBlack)
|
||||
call s:X("Cursor",s:background_color,"b0d0f0","","","")
|
||||
|
||||
call s:X("LineNr","605958",s:background_color,"NONE",s:termBlack,"")
|
||||
call s:X("CursorLineNr","ccc5c4","","NONE","White","")
|
||||
call s:X("Comment","888888","","italic","Grey","")
|
||||
call s:X("Todo","c7c7c7","","bold","White",s:termBlack)
|
||||
|
||||
call s:X("StatusLine","000000","dddddd","italic","","White")
|
||||
call s:X("StatusLineNC","ffffff","403c41","italic","White","Black")
|
||||
call s:X("VertSplit","777777","403c41","",s:termBlack,s:termBlack)
|
||||
call s:X("WildMenu","f0a0c0","302028","","Magenta","")
|
||||
|
||||
call s:X("Folded","a0a8b0","384048","italic",s:termBlack,"")
|
||||
call s:X("FoldColumn","535D66","1f1f1f","","",s:termBlack)
|
||||
call s:X("SignColumn","777777","333333","","",s:termBlack)
|
||||
call s:X("ColorColumn","","000000","","",s:termBlack)
|
||||
|
||||
call s:X("Title","70b950","","bold","Green","")
|
||||
|
||||
call s:X("Constant","cf6a4c","","","Red","")
|
||||
call s:X("Special","799d6a","","","Green","")
|
||||
call s:X("Delimiter","668799","","","Grey","")
|
||||
|
||||
call s:X("String","99ad6a","","","Green","")
|
||||
call s:X("StringDelimiter","556633","","","DarkGreen","")
|
||||
|
||||
call s:X("Identifier","c6b6ee","","","LightCyan","")
|
||||
call s:X("Structure","8fbfdc","","","LightCyan","")
|
||||
call s:X("Function","fad07a","","","Yellow","")
|
||||
call s:X("Statement","8197bf","","","DarkBlue","")
|
||||
call s:X("PreProc","8fbfdc","","","LightBlue","")
|
||||
|
||||
hi! link Operator Structure
|
||||
hi! link Conceal Operator
|
||||
|
||||
call s:X("Type","ffb964","","","Yellow","")
|
||||
call s:X("NonText","606060",s:background_color,"",s:termBlack,"")
|
||||
|
||||
call s:X("SpecialKey","444444","1c1c1c","",s:termBlack,"")
|
||||
|
||||
call s:X("Search","f0a0c0","302028","underline","Magenta","")
|
||||
|
||||
call s:X("Directory","dad085","","","Yellow","")
|
||||
call s:X("ErrorMsg","","902020","","","DarkRed")
|
||||
hi! link Error ErrorMsg
|
||||
hi! link MoreMsg Special
|
||||
call s:X("Question","65C254","","","Green","")
|
||||
|
||||
|
||||
" Spell Checking
|
||||
|
||||
call s:X("SpellBad","","902020","underline","","DarkRed")
|
||||
call s:X("SpellCap","","0000df","underline","","Blue")
|
||||
call s:X("SpellRare","","540063","underline","","DarkMagenta")
|
||||
call s:X("SpellLocal","","2D7067","underline","","Green")
|
||||
|
||||
" Diff
|
||||
|
||||
hi! link diffRemoved Constant
|
||||
hi! link diffAdded String
|
||||
|
||||
" VimDiff
|
||||
|
||||
call s:X("DiffAdd","D2EBBE","437019","","White","DarkGreen")
|
||||
call s:X("DiffDelete","40000A","700009","","DarkRed","DarkRed")
|
||||
call s:X("DiffChange","","2B5B77","","White","DarkBlue")
|
||||
call s:X("DiffText","8fbfdc","000000","reverse","Yellow","")
|
||||
|
||||
" PHP
|
||||
|
||||
hi! link phpFunctions Function
|
||||
call s:X("StorageClass","c59f6f","","","Red","")
|
||||
hi! link phpSuperglobal Identifier
|
||||
hi! link phpQuoteSingle StringDelimiter
|
||||
hi! link phpQuoteDouble StringDelimiter
|
||||
hi! link phpBoolean Constant
|
||||
hi! link phpNull Constant
|
||||
hi! link phpArrayPair Operator
|
||||
hi! link phpOperator Normal
|
||||
hi! link phpRelation Normal
|
||||
hi! link phpVarSelector Identifier
|
||||
|
||||
" Python
|
||||
|
||||
hi! link pythonOperator Statement
|
||||
|
||||
" Ruby
|
||||
|
||||
hi! link rubySharpBang Comment
|
||||
call s:X("rubyClass","447799","","","DarkBlue","")
|
||||
call s:X("rubyIdentifier","c6b6fe","","","Cyan","")
|
||||
hi! link rubyConstant Type
|
||||
hi! link rubyFunction Function
|
||||
|
||||
call s:X("rubyInstanceVariable","c6b6fe","","","Cyan","")
|
||||
call s:X("rubySymbol","7697d6","","","Blue","")
|
||||
hi! link rubyGlobalVariable rubyInstanceVariable
|
||||
hi! link rubyModule rubyClass
|
||||
call s:X("rubyControl","7597c6","","","Blue","")
|
||||
|
||||
hi! link rubyString String
|
||||
hi! link rubyStringDelimiter StringDelimiter
|
||||
hi! link rubyInterpolationDelimiter Identifier
|
||||
|
||||
call s:X("rubyRegexpDelimiter","540063","","","Magenta","")
|
||||
call s:X("rubyRegexp","dd0093","","","DarkMagenta","")
|
||||
call s:X("rubyRegexpSpecial","a40073","","","Magenta","")
|
||||
|
||||
call s:X("rubyPredefinedIdentifier","de5577","","","Red","")
|
||||
|
||||
" Erlang
|
||||
|
||||
hi! link erlangAtom rubySymbol
|
||||
hi! link erlangBIF rubyPredefinedIdentifier
|
||||
hi! link erlangFunction rubyPredefinedIdentifier
|
||||
hi! link erlangDirective Statement
|
||||
hi! link erlangNode Identifier
|
||||
|
||||
" Elixir
|
||||
|
||||
hi! link elixirAtom rubySymbol
|
||||
|
||||
|
||||
" JavaScript
|
||||
|
||||
hi! link javaScriptValue Constant
|
||||
hi! link javaScriptRegexpString rubyRegexp
|
||||
hi! link javaScriptTemplateVar StringDelim
|
||||
hi! link javaScriptTemplateDelim Identifier
|
||||
hi! link javaScriptTemplateString String
|
||||
|
||||
" CoffeeScript
|
||||
|
||||
hi! link coffeeRegExp javaScriptRegexpString
|
||||
|
||||
" Lua
|
||||
|
||||
hi! link luaOperator Conditional
|
||||
|
||||
" C
|
||||
|
||||
hi! link cFormat Identifier
|
||||
hi! link cOperator Constant
|
||||
|
||||
" Objective-C/Cocoa
|
||||
|
||||
hi! link objcClass Type
|
||||
hi! link cocoaClass objcClass
|
||||
hi! link objcSubclass objcClass
|
||||
hi! link objcSuperclass objcClass
|
||||
hi! link objcDirective rubyClass
|
||||
hi! link objcStatement Constant
|
||||
hi! link cocoaFunction Function
|
||||
hi! link objcMethodName Identifier
|
||||
hi! link objcMethodArg Normal
|
||||
hi! link objcMessageName Identifier
|
||||
|
||||
" Vimscript
|
||||
|
||||
hi! link vimOper Normal
|
||||
|
||||
" HTML
|
||||
|
||||
hi! link htmlTag Statement
|
||||
hi! link htmlEndTag htmlTag
|
||||
hi! link htmlTagName htmlTag
|
||||
|
||||
" XML
|
||||
|
||||
hi! link xmlTag Statement
|
||||
hi! link xmlEndTag xmlTag
|
||||
hi! link xmlTagName xmlTag
|
||||
hi! link xmlEqual xmlTag
|
||||
hi! link xmlEntity Special
|
||||
hi! link xmlEntityPunct xmlEntity
|
||||
hi! link xmlDocTypeDecl PreProc
|
||||
hi! link xmlDocTypeKeyword PreProc
|
||||
hi! link xmlProcessingDelim xmlAttrib
|
||||
|
||||
" Debugger.vim
|
||||
|
||||
call s:X("DbgCurrent","DEEBFE","345FA8","","White","DarkBlue")
|
||||
call s:X("DbgBreakPt","","4F0037","","","DarkMagenta")
|
||||
|
||||
" vim-indent-guides
|
||||
|
||||
if !exists("g:indent_guides_auto_colors")
|
||||
let g:indent_guides_auto_colors = 0
|
||||
endif
|
||||
call s:X("IndentGuidesOdd","","232323","","","")
|
||||
call s:X("IndentGuidesEven","","1b1b1b","","","")
|
||||
|
||||
" Plugins, etc.
|
||||
|
||||
hi! link TagListFileName Directory
|
||||
call s:X("PreciseJumpTarget","B9ED67","405026","","White","Green")
|
||||
|
||||
" Manual overrides for 256-color terminals. Dark colors auto-map badly.
|
||||
if !s:low_color
|
||||
hi StatusLineNC ctermbg=235
|
||||
hi Folded ctermbg=236
|
||||
hi DiffText ctermfg=81
|
||||
hi DbgBreakPt ctermbg=53
|
||||
hi IndentGuidesOdd ctermbg=235
|
||||
hi IndentGuidesEven ctermbg=234
|
||||
endif
|
||||
|
||||
if !empty("s:overrides")
|
||||
fun! s:current_attr(group)
|
||||
let l:synid = synIDtrans(hlID(a:group))
|
||||
let l:attrs = []
|
||||
for l:attr in ["bold", "italic", "reverse", "standout", "underline", "undercurl"]
|
||||
if synIDattr(l:synid, l:attr, "gui") == 1
|
||||
call add(l:attrs, l:attr)
|
||||
endif
|
||||
endfor
|
||||
return join(l:attrs, ",")
|
||||
endfun
|
||||
fun! s:current_color(group, what, mode)
|
||||
let l:color = synIDattr(synIDtrans(hlID(a:group)), a:what, a:mode)
|
||||
if l:color == -1
|
||||
return ""
|
||||
else
|
||||
return substitute(l:color, "^#", "", "")
|
||||
endif
|
||||
endfun
|
||||
fun! s:load_color_def(group, def)
|
||||
call s:X(a:group, get(a:def, "guifg", s:current_color(a:group, "fg", "gui")),
|
||||
\ get(a:def, "guibg", s:current_color(a:group, "bg", "gui")),
|
||||
\ get(a:def, "attr", s:current_attr(a:group)),
|
||||
\ get(a:def, "ctermfg", s:current_color(a:group, "fg", "cterm")),
|
||||
\ get(a:def, "ctermbg", s:current_color(a:group, "bg", "cterm")))
|
||||
if !s:low_color
|
||||
for l:prop in ["ctermfg", "ctermbg"]
|
||||
let l:override_key = "256".l:prop
|
||||
if has_key(a:def, l:override_key)
|
||||
exec "hi ".a:group." ".l:prop."=".a:def[l:override_key]
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
endfun
|
||||
fun! s:load_colors(defs)
|
||||
for [l:group, l:def] in items(a:defs)
|
||||
if l:group == "background"
|
||||
call s:load_color_def("LineNr", l:def)
|
||||
call s:load_color_def("NonText", l:def)
|
||||
call s:load_color_def("Normal", l:def)
|
||||
else
|
||||
call s:load_color_def(l:group, l:def)
|
||||
endif
|
||||
unlet l:group
|
||||
unlet l:def
|
||||
endfor
|
||||
endfun
|
||||
call s:load_colors(s:overrides)
|
||||
delf s:load_colors
|
||||
delf s:load_color_def
|
||||
delf s:current_color
|
||||
delf s:current_attr
|
||||
endif
|
||||
|
||||
" delete functions {{{
|
||||
delf s:X
|
||||
delf s:remove_italic_attr
|
||||
delf s:prefix_highlight_value_with
|
||||
delf s:rgb
|
||||
delf s:is_empty_or_none
|
||||
delf s:color
|
||||
delf s:rgb_color
|
||||
delf s:rgb_level
|
||||
delf s:rgb_number
|
||||
delf s:grey_color
|
||||
delf s:grey_level
|
||||
delf s:grey_number
|
||||
" }}}
|
@ -1,276 +0,0 @@
|
||||
" Vim color file
|
||||
"
|
||||
" Author: Tomas Restrepo <tomas@winterdom.com>
|
||||
" https://github.com/tomasr/molokai
|
||||
"
|
||||
" Note: Based on the Monokai theme for TextMate
|
||||
" by Wimer Hazenberg and its darker variant
|
||||
" by Hamish Stuart Macpherson
|
||||
"
|
||||
|
||||
hi clear
|
||||
|
||||
if version > 580
|
||||
" no guarantees for version 5.8 and below, but this makes it stop
|
||||
" complaining
|
||||
hi clear
|
||||
if exists("syntax_on")
|
||||
syntax reset
|
||||
endif
|
||||
endif
|
||||
let g:colors_name="molokai"
|
||||
|
||||
if exists("g:molokai_original")
|
||||
let s:molokai_original = g:molokai_original
|
||||
else
|
||||
let s:molokai_original = 0
|
||||
endif
|
||||
|
||||
|
||||
hi Boolean guifg=#AE81FF
|
||||
hi Character guifg=#E6DB74
|
||||
hi Number guifg=#AE81FF
|
||||
hi String guifg=#E6DB74
|
||||
hi Conditional guifg=#F92672 gui=bold
|
||||
hi Constant guifg=#AE81FF gui=bold
|
||||
hi Cursor guifg=#000000 guibg=#F8F8F0
|
||||
hi iCursor guifg=#000000 guibg=#F8F8F0
|
||||
hi Debug guifg=#BCA3A3 gui=bold
|
||||
hi Define guifg=#66D9EF
|
||||
hi Delimiter guifg=#8F8F8F
|
||||
hi DiffAdd guibg=#13354A
|
||||
hi DiffChange guifg=#89807D guibg=#4C4745
|
||||
hi DiffDelete guifg=#960050 guibg=#1E0010
|
||||
hi DiffText guibg=#4C4745 gui=italic,bold
|
||||
|
||||
hi Directory guifg=#A6E22E gui=bold
|
||||
hi Error guifg=#E6DB74 guibg=#1E0010
|
||||
hi ErrorMsg guifg=#F92672 guibg=#232526 gui=bold
|
||||
hi Exception guifg=#A6E22E gui=bold
|
||||
hi Float guifg=#AE81FF
|
||||
hi FoldColumn guifg=#465457 guibg=#000000
|
||||
hi Folded guifg=#465457 guibg=#000000
|
||||
hi Function guifg=#A6E22E
|
||||
hi Identifier guifg=#FD971F
|
||||
hi Ignore guifg=#808080 guibg=bg
|
||||
hi IncSearch guifg=#C4BE89 guibg=#000000
|
||||
|
||||
hi Keyword guifg=#F92672 gui=bold
|
||||
hi Label guifg=#E6DB74 gui=none
|
||||
hi Macro guifg=#C4BE89 gui=italic
|
||||
hi SpecialKey guifg=#66D9EF gui=italic
|
||||
|
||||
hi MatchParen guifg=#000000 guibg=#FD971F gui=bold
|
||||
hi ModeMsg guifg=#E6DB74
|
||||
hi MoreMsg guifg=#E6DB74
|
||||
hi Operator guifg=#F92672
|
||||
|
||||
" complete menu
|
||||
hi Pmenu guifg=#66D9EF guibg=#000000
|
||||
hi PmenuSel guibg=#808080
|
||||
hi PmenuSbar guibg=#080808
|
||||
hi PmenuThumb guifg=#66D9EF
|
||||
|
||||
hi PreCondit guifg=#A6E22E gui=bold
|
||||
hi PreProc guifg=#A6E22E
|
||||
hi Question guifg=#66D9EF
|
||||
hi Repeat guifg=#F92672 gui=bold
|
||||
hi Search guifg=#000000 guibg=#FFE792
|
||||
" marks
|
||||
hi SignColumn guifg=#A6E22E guibg=#232526
|
||||
hi SpecialChar guifg=#F92672 gui=bold
|
||||
hi SpecialComment guifg=#7E8E91 gui=bold
|
||||
hi Special guifg=#66D9EF guibg=bg gui=italic
|
||||
if has("spell")
|
||||
hi SpellBad guisp=#FF0000 gui=undercurl
|
||||
hi SpellCap guisp=#7070F0 gui=undercurl
|
||||
hi SpellLocal guisp=#70F0F0 gui=undercurl
|
||||
hi SpellRare guisp=#FFFFFF gui=undercurl
|
||||
endif
|
||||
hi Statement guifg=#F92672 gui=bold
|
||||
hi StatusLine guifg=#455354 guibg=fg
|
||||
hi StatusLineNC guifg=#808080 guibg=#080808
|
||||
hi StorageClass guifg=#FD971F gui=italic
|
||||
hi Structure guifg=#66D9EF
|
||||
hi Tag guifg=#F92672 gui=italic
|
||||
hi Title guifg=#ef5939
|
||||
hi Todo guifg=#FFFFFF guibg=bg gui=bold
|
||||
|
||||
hi Typedef guifg=#66D9EF
|
||||
hi Type guifg=#66D9EF gui=none
|
||||
hi Underlined guifg=#808080 gui=underline
|
||||
|
||||
hi VertSplit guifg=#808080 guibg=#080808 gui=bold
|
||||
hi VisualNOS guibg=#403D3D
|
||||
hi Visual guibg=#403D3D
|
||||
hi WarningMsg guifg=#FFFFFF guibg=#333333 gui=bold
|
||||
hi WildMenu guifg=#66D9EF guibg=#000000
|
||||
|
||||
hi TabLineFill guifg=#1B1D1E guibg=#1B1D1E
|
||||
hi TabLine guibg=#1B1D1E guifg=#808080 gui=none
|
||||
|
||||
if s:molokai_original == 1
|
||||
hi Normal guifg=#F8F8F2 guibg=#272822
|
||||
hi Comment guifg=#75715E
|
||||
hi CursorLine guibg=#3E3D32
|
||||
hi CursorLineNr guifg=#FD971F gui=none
|
||||
hi CursorColumn guibg=#3E3D32
|
||||
hi ColorColumn guibg=#3B3A32
|
||||
hi LineNr guifg=#BCBCBC guibg=#3B3A32
|
||||
hi NonText guifg=#75715E
|
||||
hi SpecialKey guifg=#75715E
|
||||
else
|
||||
hi Normal guifg=#F8F8F2 guibg=#1B1D1E
|
||||
hi Comment guifg=#7E8E91
|
||||
hi CursorLine guibg=#293739
|
||||
hi CursorLineNr guifg=#FD971F gui=none
|
||||
hi CursorColumn guibg=#293739
|
||||
hi ColorColumn guibg=#232526
|
||||
hi LineNr guifg=#465457 guibg=#232526
|
||||
hi NonText guifg=#465457
|
||||
hi SpecialKey guifg=#465457
|
||||
end
|
||||
|
||||
"
|
||||
" Support for 256-color terminal
|
||||
"
|
||||
if &t_Co > 255
|
||||
if s:molokai_original == 1
|
||||
hi Normal ctermbg=234
|
||||
hi CursorLine ctermbg=235 cterm=none
|
||||
hi CursorLineNr ctermfg=208 cterm=none
|
||||
else
|
||||
hi Normal ctermfg=252 ctermbg=233
|
||||
hi CursorLine ctermbg=234 cterm=none
|
||||
hi CursorLineNr ctermfg=208 cterm=none
|
||||
endif
|
||||
hi Boolean ctermfg=135
|
||||
hi Character ctermfg=144
|
||||
hi Number ctermfg=135
|
||||
hi String ctermfg=144
|
||||
hi Conditional ctermfg=161 cterm=bold
|
||||
hi Constant ctermfg=135 cterm=bold
|
||||
hi Cursor ctermfg=16 ctermbg=253
|
||||
hi Debug ctermfg=225 cterm=bold
|
||||
hi Define ctermfg=81
|
||||
hi Delimiter ctermfg=241
|
||||
|
||||
hi DiffAdd ctermbg=24
|
||||
hi DiffChange ctermfg=181 ctermbg=239
|
||||
hi DiffDelete ctermfg=162 ctermbg=53
|
||||
hi DiffText ctermbg=102 cterm=bold
|
||||
|
||||
hi Directory ctermfg=118 cterm=bold
|
||||
hi Error ctermfg=219 ctermbg=89
|
||||
hi ErrorMsg ctermfg=199 ctermbg=16 cterm=bold
|
||||
hi Exception ctermfg=118 cterm=bold
|
||||
hi Float ctermfg=135
|
||||
hi FoldColumn ctermfg=67 ctermbg=16
|
||||
hi Folded ctermfg=67 ctermbg=16
|
||||
hi Function ctermfg=118
|
||||
hi Identifier ctermfg=208 cterm=none
|
||||
hi Ignore ctermfg=244 ctermbg=232
|
||||
hi IncSearch ctermfg=193 ctermbg=16
|
||||
|
||||
hi keyword ctermfg=161 cterm=bold
|
||||
hi Label ctermfg=229 cterm=none
|
||||
hi Macro ctermfg=193
|
||||
hi SpecialKey ctermfg=81
|
||||
|
||||
hi MatchParen ctermfg=233 ctermbg=208 cterm=bold
|
||||
hi ModeMsg ctermfg=229
|
||||
hi MoreMsg ctermfg=229
|
||||
hi Operator ctermfg=161
|
||||
|
||||
" complete menu
|
||||
hi Pmenu ctermfg=81 ctermbg=16
|
||||
hi PmenuSel ctermfg=255 ctermbg=242
|
||||
hi PmenuSbar ctermbg=232
|
||||
hi PmenuThumb ctermfg=81
|
||||
|
||||
hi PreCondit ctermfg=118 cterm=bold
|
||||
hi PreProc ctermfg=118
|
||||
hi Question ctermfg=81
|
||||
hi Repeat ctermfg=161 cterm=bold
|
||||
hi Search ctermfg=0 ctermbg=222 cterm=NONE
|
||||
|
||||
" marks column
|
||||
hi SignColumn ctermfg=118 ctermbg=235
|
||||
hi SpecialChar ctermfg=161 cterm=bold
|
||||
hi SpecialComment ctermfg=245 cterm=bold
|
||||
hi Special ctermfg=81
|
||||
if has("spell")
|
||||
hi SpellBad ctermbg=52
|
||||
hi SpellCap ctermbg=17
|
||||
hi SpellLocal ctermbg=17
|
||||
hi SpellRare ctermfg=none ctermbg=none cterm=reverse
|
||||
endif
|
||||
hi Statement ctermfg=161 cterm=bold
|
||||
hi StatusLine ctermfg=238 ctermbg=253
|
||||
hi StatusLineNC ctermfg=244 ctermbg=232
|
||||
hi StorageClass ctermfg=208
|
||||
hi Structure ctermfg=81
|
||||
hi Tag ctermfg=161
|
||||
hi Title ctermfg=166
|
||||
hi Todo ctermfg=231 ctermbg=232 cterm=bold
|
||||
|
||||
hi Typedef ctermfg=81
|
||||
hi Type ctermfg=81 cterm=none
|
||||
hi Underlined ctermfg=244 cterm=underline
|
||||
|
||||
hi VertSplit ctermfg=244 ctermbg=232 cterm=bold
|
||||
hi VisualNOS ctermbg=238
|
||||
hi Visual ctermbg=235
|
||||
hi WarningMsg ctermfg=231 ctermbg=238 cterm=bold
|
||||
hi WildMenu ctermfg=81 ctermbg=16
|
||||
|
||||
hi Comment ctermfg=59
|
||||
hi CursorColumn ctermbg=236
|
||||
hi ColorColumn ctermbg=236
|
||||
hi LineNr ctermfg=250 ctermbg=236
|
||||
hi NonText ctermfg=59
|
||||
|
||||
hi SpecialKey ctermfg=59
|
||||
|
||||
if exists("g:rehash256") && g:rehash256 == 1
|
||||
hi Normal ctermfg=252 ctermbg=234
|
||||
hi CursorLine ctermbg=236 cterm=none
|
||||
hi CursorLineNr ctermfg=208 cterm=none
|
||||
|
||||
hi Boolean ctermfg=141
|
||||
hi Character ctermfg=222
|
||||
hi Number ctermfg=141
|
||||
hi String ctermfg=222
|
||||
hi Conditional ctermfg=197 cterm=bold
|
||||
hi Constant ctermfg=141 cterm=bold
|
||||
|
||||
hi DiffDelete ctermfg=125 ctermbg=233
|
||||
|
||||
hi Directory ctermfg=154 cterm=bold
|
||||
hi Error ctermfg=222 ctermbg=233
|
||||
hi Exception ctermfg=154 cterm=bold
|
||||
hi Float ctermfg=141
|
||||
hi Function ctermfg=154
|
||||
hi Identifier ctermfg=208
|
||||
|
||||
hi Keyword ctermfg=197 cterm=bold
|
||||
hi Operator ctermfg=197
|
||||
hi PreCondit ctermfg=154 cterm=bold
|
||||
hi PreProc ctermfg=154
|
||||
hi Repeat ctermfg=197 cterm=bold
|
||||
|
||||
hi Statement ctermfg=197 cterm=bold
|
||||
hi Tag ctermfg=197
|
||||
hi Title ctermfg=203
|
||||
hi Visual ctermbg=238
|
||||
|
||||
hi Comment ctermfg=244
|
||||
hi LineNr ctermfg=239 ctermbg=235
|
||||
hi NonText ctermfg=239
|
||||
hi SpecialKey ctermfg=239
|
||||
endif
|
||||
end
|
||||
|
||||
" Must be at the end, because of ctermbg=234 bug.
|
||||
" https://groups.google.com/forum/#!msg/vim_dev/afPqwAFNdrU/nqh6tOM87QUJ
|
||||
set background=dark
|
@ -1,229 +0,0 @@
|
||||
" Vim color scheme
|
||||
"
|
||||
" Name: railscast.vim
|
||||
" Maintainer: Josh O'Rourke <joshorourke@me.com>
|
||||
" Modified: Carlos Ramos, carakan
|
||||
" License: public domain
|
||||
"
|
||||
" A GUI Only port of the RailsCasts TextMate theme [1] to Vim.
|
||||
" Some parts of this theme were borrowed from the well-documented Lucius theme [2].
|
||||
"
|
||||
|
||||
let g:colors_name = "new-railscasts"
|
||||
hi clear
|
||||
if exists("syntax_on")
|
||||
syntax reset
|
||||
endif
|
||||
highlight clear SignColumn
|
||||
set background=dark
|
||||
|
||||
hi Normal guifg=#E6E1DC guibg=#212121 ctermfg=white ctermbg=234
|
||||
hi Cursor guifg=#000000 guibg=#FFFFFF ctermfg=0 ctermbg=15
|
||||
hi CursorLine guibg=#282828 ctermbg=235 cterm=NONE
|
||||
hi Search guibg=#072f95 ctermfg=NONE ctermbg=236
|
||||
hi Visual guibg=#004568 ctermbg=60
|
||||
hi LineNr guifg=#707070 guibg=#2d2d2d ctermfg=242
|
||||
hi StatusLine guifg=#e4e4e4 guibg=#606060 gui=NONE ctermfg=254 ctermbg=241 cterm=NONE
|
||||
hi StatusLineNC guifg=#585858 guibg=#303030 gui=NONE ctermfg=240 ctermbg=236 cterm=NONE
|
||||
|
||||
hi! link CursorColumn ColorColumn
|
||||
hi VertSplit guibg=#212121 gui=bold guifg=#444444 ctermfg=white ctermbg=234
|
||||
hi CursorLineNr guifg=#d7b0fc guibg=#2d2d2d ctermfg=248
|
||||
hi ColorColumn guibg=#333435 ctermbg=235
|
||||
highlight SignColumn guibg=#2d2d2d
|
||||
|
||||
" StatusLine
|
||||
" Bold
|
||||
hi User1 guifg=#eeeeee guibg=#606060 gui=bold ctermfg=255 ctermbg=241 cterm=bold
|
||||
" Yellow
|
||||
hi User2 guifg=#FFAF00 guibg=#606060 gui=bold ctermfg=214 ctermbg=241 cterm=bold
|
||||
" Green
|
||||
hi User3 guifg=#15d300 guibg=#606060 gui=bold ctermfg=82 ctermbg=241 cterm=bold
|
||||
" Red
|
||||
hi User4 guifg=#870000 guibg=#606060 gui=bold ctermfg=88 ctermbg=241 cterm=bold
|
||||
hi User5 guifg=#e4e4e4 guibg=#606060 gui=bold ctermfg=254 ctermbg=241 cterm=bold
|
||||
hi User6 guifg=#e4e4e4 guibg=#606060 gui=bold ctermfg=254 ctermbg=241 cterm=bold
|
||||
hi User7 guifg=#e4e4e4 guibg=#606060 gui=bold ctermfg=254 ctermbg=241 cterm=bold
|
||||
hi User8 guifg=#e4e4e4 guibg=#606060 gui=bold ctermfg=254 ctermbg=241 cterm=bold
|
||||
hi User9 guifg=#e4e4e4 guibg=#606060 gui=bold ctermfg=254 ctermbg=241 cterm=bold
|
||||
|
||||
" Folds
|
||||
" -----
|
||||
hi Folded guifg=#F6F3E8 guibg=#444444 gui=NONE
|
||||
|
||||
" Invisible Characters
|
||||
" ------------------
|
||||
hi NonText guifg=#777777 gui=NONE
|
||||
hi SpecialKey guifg=#777777 gui=NONE
|
||||
|
||||
" Misc
|
||||
" ----
|
||||
" directory names and other special names in listings
|
||||
hi Directory guifg=#A5C261 gui=NONE
|
||||
|
||||
" Popup Menu
|
||||
" ----------
|
||||
" normal item in popup
|
||||
hi Pmenu guifg=#F6F3E8 guibg=#444444 gui=NONE ctermfg=white ctermbg=237
|
||||
" selected item in popup
|
||||
hi PmenuSel guifg=#000000 guibg=#A5C261 gui=NONE
|
||||
" scrollbar in popup
|
||||
hi PMenuSbar guibg=#5A647E gui=NONE
|
||||
" thumb of the scrollbar in the popup
|
||||
hi PMenuThumb guibg=#AAAAAA gui=NONE
|
||||
|
||||
" Comment
|
||||
hi Comment guifg=#BC9458 guibg=NONE gui=italic ctermfg=137 cterm=italic
|
||||
hi Todo guifg=#df5f5f guibg=NONE gui=bold ctermfg=94
|
||||
|
||||
"rubyPseudoVariable: nil, self, symbols, etc
|
||||
hi Constant guifg=#6D9CBE ctermfg=73
|
||||
" rubyClass, rubyModule, rubyDefine def, end, include, etc
|
||||
hi Define guifg=#CC7833 ctermfg=173
|
||||
" Interpolation
|
||||
hi Delimiter guifg=#519F50
|
||||
hi WarningMsg guifg=#DA4939 guibg=NONE ctermfg=1 ctermbg=NONE
|
||||
" Error, rubyInvalidVariable
|
||||
hi Error guifg=#FFFFFF guibg=#990000 ctermfg=221 ctermbg=88
|
||||
"rubyFunction
|
||||
hi! Function guifg=#FFC66D guibg=NONE ctermfg=221 cterm=NONE
|
||||
" Identifier: @var, @@var, $var, etc
|
||||
hi Identifier guifg=#d7b0fc guibg=NONE ctermfg=73 cterm=NONE
|
||||
" Include: include, autoload, extend, load, require
|
||||
hi Include guifg=#CC7833 guibg=NONE ctermfg=173 cterm=NONE
|
||||
" Keyword, rubyKeywordAsMethod: alias, undef, super, yield, callcc, caller, lambda, proc
|
||||
hi Keyword guifg=#d8690f ctermfg=172 cterm=NONE
|
||||
" same as define
|
||||
hi Macro guifg=#CC7833 guibg=NONE ctermfg=172
|
||||
"rubyInteger
|
||||
hi Number guifg=#A5C261 ctermfg=107
|
||||
hi Boolean guifg=#47a3e5 ctermfg=107 gui=italic
|
||||
" #if, #else, #endif
|
||||
hi PreCondit guifg=#CC7833 guibg=NONE ctermfg=172 cterm=NONE
|
||||
" generic preprocessor
|
||||
hi PreProc guifg=#CC7833 guibg=NONE ctermfg=103
|
||||
" Control, Access, Eval: case, begin, do, for, if unless, while, until else, etc.
|
||||
hi Statement guifg=#CC7833 guibg=NONE ctermfg=172 cterm=NONE
|
||||
" String
|
||||
hi String guifg=#74d155 guibg=NONE ctermfg=107
|
||||
hi! Title guifg=#FFFFFF guibg=NONE ctermfg=15
|
||||
" Constant
|
||||
hi Type guifg=#ff5d4f guibg=NONE gui=NONE
|
||||
hi PreProc guifg=#ff8700 guibg=NONE ctermfg=208
|
||||
hi Special guifg=#ff8700 guibg=NONE ctermfg=22
|
||||
hi Operator guifg=#CC7833 guibg=NONE ctermfg=73
|
||||
hi Tag guifg=#CC7833 guibg=NONE ctermfg=73
|
||||
hi Label guifg=#6D9CBE ctermfg=221 gui=bold
|
||||
|
||||
" Indentation
|
||||
hi IndentGuidesOdd ctermbg=239 guibg=#282828
|
||||
hi IndentGuidesEven ctermbg=237 guibg=#332717
|
||||
|
||||
" Diffs
|
||||
hi DiffAdd guifg=#e4e4e4 guibg=#519F50 ctermfg=254 ctermbg=22
|
||||
hi DiffDelete guifg=#e4e4e4 guibg=#660000 gui=bold ctermfg=16 ctermbg=52 cterm=bold
|
||||
hi DiffChange guifg=#FFFFFF guibg=#870087 ctermfg=15 ctermbg=90
|
||||
hi DiffText guifg=#FFC66D guibg=#FF0000 gui=bold ctermfg=15 ctermbg=9 cterm=bold
|
||||
|
||||
hi diffAdded guifg=#008700 ctermfg=28
|
||||
hi diffRemoved guifg=#800000 ctermfg=1
|
||||
hi diffNewFile guifg=#FFFFFF guibg=NONE gui=bold ctermfg=15 ctermbg=NONE cterm=bold
|
||||
hi diffFile guifg=#FFFFFF guibg=NONE gui=bold ctermfg=15 ctermbg=NONE cterm=bold
|
||||
|
||||
|
||||
hi javaScriptOperator guifg=#c9d05c ctermfg=185 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||
hi javaScriptBraces guifg=#dd7927 ctermfg=153 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||
hi javaScriptNull guifg=#dd7927 ctermfg=215 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||
|
||||
" Ruby
|
||||
" ----
|
||||
hi rubyTodo guifg=#fc5858 guibg=NONE gui=bold ctermfg=167 ctermbg=NONE cterm=bold
|
||||
hi rubyClass guifg=#dd7927 ctermfg=15
|
||||
hi rubyConstant guifg=#fc5858 ctermfg=167
|
||||
hi rubyInterpolation guifg=#ea8c3f ctermfg=15
|
||||
hi rubyBlockParameter guifg=#d7b0fc ctermfg=189
|
||||
hi rubyPseudoVariable guifg=#47a3e5 ctermfg=221 gui=italic
|
||||
hi rubySymbol guifg=#6D9CBE ctermfg=73 gui=bold
|
||||
hi rubyStringDelimiter guifg=#87af5f ctermfg=107
|
||||
hi rubyInstanceVariable guifg=#d7b0fc ctermfg=189
|
||||
hi rubyPredefinedConstant guifg=#fc5858 ctermfg=167
|
||||
hi rubyLocalVariableOrMethod guifg=#d7b0fc ctermfg=189
|
||||
hi rubyBoolean guifg=#47a3e5 gui=italic
|
||||
|
||||
" JAVASCRIPT
|
||||
"
|
||||
hi jsFunction guifg=#ff8700 ctermfg=221 gui=italic
|
||||
hi jsFunctionKey guifg=#ff8700 ctermfg=221 gui=italic
|
||||
hi jsArrowFunction guifg=#ff8700 ctermfg=221
|
||||
hi jsObjectKey guifg=#6D9CBE ctermfg=73 gui=bold
|
||||
hi jsThis guifg=#d7b0fc ctermfg=189 gui=italic
|
||||
hi jsStorageClass guifg=#fc5858 ctermfg=167 gui=italic
|
||||
hi jsNull guifg=#ff8700 ctermfg=221 gui=italic
|
||||
|
||||
" Typescript
|
||||
"
|
||||
hi typescriptArrowFunc guifg=#ff8700 ctermfg=221 gui=italic
|
||||
hi typescriptIdentifier guifg=#d7b0fc ctermfg=189 gui=italic
|
||||
hi typescriptAsyncFuncKeyword guifg=#47a3e5 gui=italic
|
||||
hi typescriptType guifg=#ff8700 ctermfg=167 gui=italic
|
||||
hi typescriptObjectLabel guifg=#6D9CBE ctermfg=73 gui=bold
|
||||
|
||||
" Python
|
||||
" ------
|
||||
hi pythonExceptions guifg=#ffaf87 ctermfg=216
|
||||
hi pythonDoctest guifg=#8787ff ctermfg=105
|
||||
hi pythonDoctestValue guifg=#87d7af ctermfg=115
|
||||
|
||||
" Elixir
|
||||
"
|
||||
hi elixirAtom guifg=#6D9CBE ctermfg=221 gui=bold
|
||||
hi elixirTuple guifg=#6D9CBE ctermfg=221 gui=bold
|
||||
hi elixirDefine guifg=#CC7833 ctermfg=173 gui=bold
|
||||
hi elixirPrivateDefine guifg=#CC7833 ctermfg=173 gui=bold
|
||||
hi elixirModuleDefine guifg=#CC7833 ctermfg=173 gui=bold
|
||||
|
||||
" Ember.js
|
||||
"
|
||||
hi hbsProperty guifg=#ff8700 ctermfg=221 gui=italic
|
||||
hi mustacheHandlebars guifg=#CC7833 ctermfg=173 gui=bold
|
||||
|
||||
" CSS
|
||||
hi cssClassName guifg=#FFC66D gui=italic
|
||||
hi cssIdentifier guifg=#47a3e5 gui=italic
|
||||
|
||||
" JSON
|
||||
hi jsonBoolean guifg=#47a3e5 gui=italic
|
||||
hi jsonNull guifg=#47a3e5 gui=italic
|
||||
|
||||
" yaml
|
||||
hi yamlKey guifg=#d7b0fc ctermfg=189 gui=bold
|
||||
|
||||
" Mail
|
||||
" ----
|
||||
hi mailEmail guifg=#87af5f ctermfg=107 gui=italic cterm=underline
|
||||
hi mailHeaderKey guifg=#ffdf5f ctermfg=221
|
||||
hi! link mailSubject mailHeaderKey
|
||||
|
||||
" Spell
|
||||
" ----
|
||||
hi! SpellBad guifg=#df5f87 guibg=NONE gui=NONE ctermfg=160 ctermbg=NONE cterm=underline
|
||||
hi! SpellRare guifg=#df5f87 guibg=NONE gui=NONE ctermfg=168 ctermbg=NONE cterm=underline
|
||||
hi! SpellCap guifg=#dfdfff guibg=NONE gui=NONE ctermfg=189 ctermbg=NONE cterm=underline
|
||||
hi! SpellLocal guifg=#00FFFF guibg=NONE gui=NONE ctermfg=51 ctermbg=NONE cterm=underline
|
||||
hi! MatchParen guifg=#FFFFFF guibg=#005f5f ctermfg=15 ctermbg=23
|
||||
hi! Question guifg=#df5f87 guibg=NONE gui=NONE ctermfg=168 ctermbg=NONE cterm=underline
|
||||
|
||||
" XML
|
||||
" ---
|
||||
hi xmlTag guifg=#dfaf5f ctermfg=179
|
||||
hi xmlTagName guifg=#dfaf5f ctermfg=179
|
||||
hi xmlEndTag guifg=#dfaf5f ctermfg=179
|
||||
|
||||
hi link htmlTag xmlTag
|
||||
hi link htmlTagName xmlTagName
|
||||
hi link htmlEndTag xmlEndTag
|
||||
hi htmlArg guifg=#ff8700 ctermfg=221 gui=italic
|
||||
|
||||
hi checkbox guifg=#3a3a3a guibg=NONE gui=NONE ctermfg=237 ctermbg=NONE cterm=NONE
|
||||
hi checkboxDone guifg=#15d300 guibg=NONE gui=BOLD ctermfg=82 ctermbg=NONE cterm=BOLD
|
||||
hi checkboxNotDone guifg=#005fdf guibg=NONE gui=BOLD ctermfg=26 ctermbg=NONE cterm=BOLD
|
@ -1,19 +0,0 @@
|
||||
" This config includes custom settings for special filetypes
|
||||
|
||||
" Markdown / .md
|
||||
function Markdown()
|
||||
set filetype=markdown
|
||||
endfunction
|
||||
|
||||
autocmd BufNewFile,BufReadPost *.Rmd call Markdown()
|
||||
autocmd BufNewFile,BufReadPost *.rmd call Markdown()
|
||||
autocmd BufNewFile,BufReadPost *.md call Markdown()
|
||||
|
||||
|
||||
" Groovy syntax highlighting
|
||||
au BufNewFile,BufRead Jenkinsfile set filetype=groovy
|
||||
au BufNewFile,BufRead *.bu set filetype=yaml
|
||||
|
||||
|
||||
au BufNewFile,BufRead .latexmkrc set filetype=perl
|
||||
au BufNewFile,BufRead .tex set filetype=latex
|
@ -1,102 +0,0 @@
|
||||
" No Arrowkeys
|
||||
no <up> <NOP>
|
||||
no <down> <NOP>
|
||||
no <left> <NOP>
|
||||
no <right> <NOP>
|
||||
ino <up> <NOP>
|
||||
ino <down> <NOP>
|
||||
ino <left> <NOP>
|
||||
ino <right> <NOP>
|
||||
vno <up> <NOP>
|
||||
vno <down> <NOP>
|
||||
vno <left> <NOP>
|
||||
vno <right> <NOP>
|
||||
|
||||
|
||||
" Misc Keybindings
|
||||
let mapleader = ","
|
||||
|
||||
" Buffers
|
||||
nmap <F3> :Buffers<CR>
|
||||
imap <F3> <ESC><ESC>:Buffers<CR>
|
||||
vmap <F3> <ESC><ESC>:Buffers<CR>
|
||||
|
||||
" Bufferline.nvim
|
||||
nnoremap <silent>[b :BufferLineCyclePrev<CR>
|
||||
nnoremap <silent>]b :BufferLineCycleNext<CR>
|
||||
|
||||
" Nerdtree
|
||||
nmap <silent> <F2> <ESC>:NERDTreeToggle<CR>
|
||||
|
||||
" Tagbar
|
||||
nmap <F4> :TagbarToggle<CR>
|
||||
|
||||
" SingleCompile
|
||||
nmap <F8> :SCChooseCompiler<CR>
|
||||
nmap <F9> :SCCompile<cr>
|
||||
nmap <F10> :SCCompileRun<cr>
|
||||
|
||||
" Window Movement
|
||||
nnoremap <silent> <C-H> <C-W><C-H>
|
||||
nnoremap <silent> <C-J> <C-W><C-J>
|
||||
nnoremap <silent> <C-K> <C-W><C-K>
|
||||
nnoremap <silent> <C-L> <C-W><C-L>
|
||||
|
||||
" Yankstack
|
||||
nmap <silent> <S-P> <Plug>yankstack_substitute_newer_paste
|
||||
nmap <silent> <C-P> <Plug>yankstack_substitute_older_paste
|
||||
|
||||
" CTRL + Space = Autocomplete
|
||||
" inoremap <C-space> <C-N>
|
||||
" imap <C-@> <C-Space>
|
||||
|
||||
cmap w!! w !sudo tee > /dev/null %
|
||||
|
||||
" Toggle Case
|
||||
nmap <C-c> g~iw
|
||||
|
||||
|
||||
" Rmarkdown
|
||||
autocmd Filetype rmd nmap <F5> :w\|:!echo<space>"require(rmarkdown);<space>render('<c-r>%')"<space>\|<space>R<space>--vanilla<enter>
|
||||
autocmd Filetype rmd imap <F5> <ESC><ESC>:w\|:!echo<space>"require(rmarkdown);<space>render('<c-r>%')"<space>\|<space>R<space>--vanilla<enter>
|
||||
|
||||
map <F1> <Esc>
|
||||
imap <F1> <Esc>
|
||||
|
||||
" nvim smartbuffs
|
||||
" Jump to the N buffer (by index) according to :ls buffer list
|
||||
" where N is NOT the buffer number but the INDEX in such list
|
||||
" NOTE: it does not include terminal buffers
|
||||
nnoremap <Leader>1 :lua require("nvim-smartbufs").goto_buffer(1)<CR>
|
||||
nnoremap <Leader>2 :lua require("nvim-smartbufs").goto_buffer(2)<CR>
|
||||
nnoremap <Leader>3 :lua require("nvim-smartbufs").goto_buffer(3)<CR>
|
||||
nnoremap <Leader>4 :lua require("nvim-smartbufs").goto_buffer(4)<CR>
|
||||
nnoremap <Leader>5 :lua require("nvim-smartbufs").goto_buffer(5)<CR>
|
||||
nnoremap <Leader>6 :lua require("nvim-smartbufs").goto_buffer(6)<CR>
|
||||
nnoremap <Leader>7 :lua require("nvim-smartbufs").goto_buffer(7)<CR>
|
||||
nnoremap <Leader>8 :lua require("nvim-smartbufs").goto_buffer(8)<CR>
|
||||
nnoremap <Leader>9 :lua require("nvim-smartbufs").goto_buffer(9)<CR>
|
||||
|
||||
" Improved :bnext :bprev behavior (without considering terminal buffers)
|
||||
nnoremap <Right> :lua require("nvim-smartbufs").goto_next_buffer()<CR>
|
||||
nnoremap <Left> :lua require("nvim-smartbufs").goto_prev_buffer()<CR>
|
||||
|
||||
" Open terminal buffer and set it as hidden so it won't get deleted
|
||||
nnoremap <Leader>c1 :lua require("nvim-smartbufs").goto_terminal(1)<CR>
|
||||
nnoremap <Leader>c2 :lua require("nvim-smartbufs").goto_terminal(2)<CR>
|
||||
nnoremap <Leader>c3 :lua require("nvim-smartbufs").goto_terminal(3)<CR>
|
||||
nnoremap <Leader>c4 :lua require("nvim-smartbufs").goto_terminal(4)<CR>
|
||||
|
||||
" Delete current buffer and goes back to the previous one
|
||||
nnoremap <Leader>qq :lua require("nvim-smartbufs").close_current_buffer()<CR>
|
||||
|
||||
" Delete the N buffer according to :ls buffer list
|
||||
nnoremap <Leader>q1 :lua require("nvim-smartbufs").close_buffer(1)<CR>
|
||||
nnoremap <Leader>q2 :lua require("nvim-smartbufs").close_buffer(2)<CR>
|
||||
nnoremap <Leader>q3 :lua require("nvim-smartbufs").close_buffer(3)<CR>
|
||||
nnoremap <Leader>q4 :lua require("nvim-smartbufs").close_buffer(4)<CR>
|
||||
nnoremap <Leader>q5 :lua require("nvim-smartbufs").close_buffer(5)<CR>
|
||||
nnoremap <Leader>q6 :lua require("nvim-smartbufs").close_buffer(6)<CR>
|
||||
nnoremap <Leader>q7 :lua require("nvim-smartbufs").close_buffer(7)<CR>
|
||||
nnoremap <Leader>q8 :lua require("nvim-smartbufs").close_buffer(8)<CR>
|
||||
nnoremap <Leader>q9 :lua require("nvim-smartbufs").close_buffer(9)<CR>
|
@ -1,293 +0,0 @@
|
||||
" Airline
|
||||
if !exists('g:airline_symbols')
|
||||
let g:airline_symbols = {}
|
||||
endif
|
||||
let g:airline_left_sep = ''
|
||||
let g:airline_left_alt_sep = ''
|
||||
let g:airline_right_sep = ''
|
||||
let g:airline_right_alt_sep = ''
|
||||
let g:airline_symbols.branch = ''
|
||||
let g:airline_symbols.readonly = ''
|
||||
let g:airline_symbols.linenr = ''
|
||||
let g:airline#extensions#tabline#left_sep=''
|
||||
let g:airline#extensions#tabline#left_alt_sep=''
|
||||
let g:airline_symbols.maxlinenr = ''
|
||||
let g:airline#extensions#tabline#enabled = 0
|
||||
let g:airline#extensions#wordcount#enabled = 1
|
||||
let g:airline_theme="minimalist"
|
||||
|
||||
|
||||
" bufferline.nvim
|
||||
set termguicolors
|
||||
lua << EOF
|
||||
require("bufferline").setup {
|
||||
options = {
|
||||
diagnostics = "coc",
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
" GitGutter
|
||||
autocmd TextChanged * GitGutter
|
||||
|
||||
|
||||
" JavaComplete
|
||||
autocmd Filetype java setlocal omnifunc=javacomplete#CompleteParamsInfo
|
||||
|
||||
|
||||
" NerdCommenter
|
||||
let g:NERDSpaceDelims = 1
|
||||
let g:NERDCompactSexyComs = 1
|
||||
let g:NERDDefaultAlign = "left"
|
||||
let g:NERDCommentEmptyLines = 1
|
||||
let g:NERDTrimTrailingWhitespace = 1
|
||||
|
||||
|
||||
" NerdTree
|
||||
let NERDTreeMinimalUI = 0
|
||||
let g:NERDTreeHighlightFolders = 1
|
||||
let g:NERDTreeHighlightFoldersFullName = 1
|
||||
|
||||
" autoclose if nerdtree is last open window
|
||||
augroup NERDTree
|
||||
autocmd!
|
||||
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
|
||||
augroup end
|
||||
|
||||
|
||||
" python syntax
|
||||
let g:python_highlight_all = 1
|
||||
|
||||
|
||||
" Simpylfold
|
||||
let g:SimpylFold_docstring_preview = 1
|
||||
|
||||
|
||||
" Ale
|
||||
let g:ale_linters = {"python": ["flake8"], "python3": ["flake8"]}
|
||||
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
|
||||
let g:ale_sign_error = '✘'
|
||||
let g:ale_sign_warning = '⚠'
|
||||
|
||||
|
||||
" VIM-MARKDOWN
|
||||
let g:markdown_syntax_conceal=0
|
||||
let g:vim_markdown_conceal = 0
|
||||
|
||||
|
||||
" Whitespace
|
||||
autocmd BufEnter *[^(.rmd|.snippets)] EnableStripWhitespaceOnSave
|
||||
autocmd BufEnter *.snippets DisableStripWhitespaceOnSave
|
||||
|
||||
|
||||
" Yankstack
|
||||
let g:yankstack_map_keys = 0
|
||||
call yankstack#setup()
|
||||
|
||||
" Copilot
|
||||
imap <silent><script><expr> <a-cr> copilot#Accept("\<CR>")
|
||||
let g:copilot_no_tab_map = v:true
|
||||
ino <TAB> <NOP>
|
||||
highlight CopilotSuggestion guifg=#FFAF5F ctermfg=8
|
||||
|
||||
|
||||
" CoC nvim
|
||||
set hidden
|
||||
set nobackup
|
||||
set nowritebackup
|
||||
set cmdheight=2
|
||||
set updatetime=300
|
||||
set shortmess+=c
|
||||
let g:coc_filetype_map = {'tex': 'latex'}
|
||||
" Use tab for trigger completion with characters ahead and navigate.
|
||||
" Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
|
||||
|
||||
function! s:check_back_space() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~ '\s'
|
||||
endfunction
|
||||
|
||||
" Insert <tab> when previous text is space, refresh completion if not.
|
||||
inoremap <silent><expr> <TAB>
|
||||
\ coc#pum#visible() ? coc#pum#next(1):
|
||||
\ <SID>check_back_space() ? "\<Tab>" :
|
||||
\ coc#refresh()
|
||||
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
|
||||
|
||||
function! s:check_back_space() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~# '\s'
|
||||
endfunction
|
||||
|
||||
" Use <c-space> to trigger completion.
|
||||
inoremap <silent><expr> <c-space>
|
||||
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
|
||||
\ coc#refresh()
|
||||
|
||||
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
|
||||
" Coc only does snippet and additional edit on confirm.
|
||||
" inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
||||
" Or use `complete_info` if your vim support it, like:
|
||||
inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
|
||||
|
||||
" Use `[g` and `]g` to navigate diagnostics
|
||||
nmap <silent> gp <Plug>(coc-diagnostic-prev)
|
||||
nmap <silent> gn <Plug>(coc-diagnostic-next)
|
||||
|
||||
" Remap keys for gotos
|
||||
nmap <silent> gd <Plug>(coc-definition)
|
||||
nmap <silent> gy <Plug>(coc-type-definition)
|
||||
nmap <silent> gi <Plug>(coc-implementation)
|
||||
nmap <silent> gr <Plug>(coc-references)
|
||||
|
||||
" Use K to show documentation in preview window
|
||||
nnoremap <silent> K :call <SID>show_documentation()<CR>
|
||||
|
||||
function! s:show_documentation()
|
||||
if (index(['vim','help'], &filetype) >= 0)
|
||||
execute 'h '.expand('<cword>')
|
||||
else
|
||||
call CocAction('doHover')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Highlight symbol under cursor on CursorHold
|
||||
autocmd CursorHold * silent call CocActionAsync('highlight')
|
||||
|
||||
" Remap for rename current word
|
||||
nmap <leader>rn <Plug>(coc-rename)
|
||||
|
||||
" Remap for format selected region
|
||||
xmap <leader>f <Plug>(coc-format-selected)
|
||||
nmap <leader>f <Plug>(coc-format-selected)
|
||||
|
||||
augroup mygroup
|
||||
autocmd!
|
||||
" Setup formatexpr specified filetype(s).
|
||||
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
|
||||
" Update signature help on jump placeholder
|
||||
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
|
||||
augroup end
|
||||
|
||||
" Remap for do codeAction of selected region, ex: `<leader>aap` for current paragraph
|
||||
xmap <leader>a <Plug>(coc-codeaction-selected)
|
||||
nmap <leader>a <Plug>(coc-codeaction-selected)
|
||||
|
||||
" Implement methods for trait
|
||||
nnoremap <silent> <space>i :call CocActionAsync('codeAction', '', 'Implement missing members')<cr>
|
||||
|
||||
" Remap for do codeAction of current line
|
||||
nmap <leader>ac <Plug>(coc-codeaction)
|
||||
" Fix autofix problem of current line
|
||||
nmap <leader>qf <Plug>(coc-fix-current)
|
||||
|
||||
" Create mappings for function text object, requires document symbols feature of languageserver.
|
||||
xmap if <Plug>(coc-funcobj-i)
|
||||
xmap af <Plug>(coc-funcobj-a)
|
||||
omap if <Plug>(coc-funcobj-i)
|
||||
omap af <Plug>(coc-funcobj-a)
|
||||
|
||||
" Use <C-d> for select selections ranges, needs server support, like: coc-tsserver, coc-python
|
||||
nmap <silent> <C-d> <Plug>(coc-range-select)
|
||||
xmap <silent> <C-d> <Plug>(coc-range-select)
|
||||
|
||||
" Use `:Format` to format current buffer
|
||||
command! -nargs=0 Format :call CocAction('format')
|
||||
|
||||
" Use `:Fold` to fold current buffer
|
||||
command! -nargs=? Fold :call CocAction('fold', <f-args>)
|
||||
|
||||
" use `:OR` for organize import of current buffer
|
||||
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
|
||||
|
||||
" Add status line support, for integration with other plugin, checkout `:h coc-status`
|
||||
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
|
||||
|
||||
" Using CocList
|
||||
" Show all diagnostics
|
||||
nnoremap <silent> <space>a :<C-u>CocList diagnostics<cr>
|
||||
" Manage extensions
|
||||
nnoremap <silent> <space>e :<C-u>CocList extensions<cr>
|
||||
" Show commands
|
||||
nnoremap <silent> <space>c :<C-u>CocList commands<cr>
|
||||
" Find symbol of current document
|
||||
nnoremap <silent> <space>o :<C-u>CocList outline<cr>
|
||||
" Search workspace symbols
|
||||
nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
|
||||
" Do default action for next item.
|
||||
nnoremap <silent> <space>j :<C-u>CocNext<CR>
|
||||
" Do default action for previous item.
|
||||
nnoremap <silent> <space>k :<C-u>CocPrev<CR>
|
||||
" Resume latest coc list
|
||||
nnoremap <silent> <space>p :<C-u>CocListResume<CR>
|
||||
|
||||
if !exists('SessionLoad')
|
||||
" Open Tagbar
|
||||
autocmd VimEnter * nested :call tagbar#autoopen(1)
|
||||
|
||||
" Open NerdTREE
|
||||
autocmd VimEnter * NERDTree | wincmd p
|
||||
endif
|
||||
|
||||
" If another buffer tries to replace NERDTree, put it in the other window, and bring back NERDTree.
|
||||
autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 |
|
||||
\ let buf=bufnr() | buffer# | execute "normal! \<C-W>w" | execute 'buffer'.buf | endif
|
||||
|
||||
" Blame
|
||||
" lua << EOF
|
||||
" require("blame_line").setup {
|
||||
" -- whether the blame line should be shown in visual modes
|
||||
" show_in_visual = true,
|
||||
"
|
||||
" -- whether the blame line should be shown in insert mode
|
||||
" show_in_insert = true,
|
||||
"
|
||||
" -- the string to prefix the blame line with
|
||||
" prefix = " ",
|
||||
"
|
||||
" -- String specifying the the blame line format.
|
||||
" -- Any combination of the following specifiers, along with any additional text.
|
||||
" -- - `"<author>"` - the author of the change.
|
||||
" -- - `"<author-mail>"` - the email of the author.
|
||||
" -- - `"<author-time>"` - the time the author made the change.
|
||||
" -- - `"<committer>"` - the person who committed the change to the repository.
|
||||
" -- - `"<committer-mail>"` - the email of the committer.
|
||||
" -- - `"<committer-time>"` - the time the change was committed to the repository.
|
||||
" -- - `"<summary>"` - the commit summary/message.
|
||||
" -- - `"<commit-short>"` - short portion of the commit hash.
|
||||
" -- - `"<commit-long>"` - the full commit hash.
|
||||
" template = "<author> • <author-time> • <summary>",
|
||||
"
|
||||
" -- The date format settings, for `"<author-time>"` and `"<committer-time>"`
|
||||
" date = {
|
||||
" -- whether the date should be relative instead of precise
|
||||
" -- (I.E. "3 days ago" instead of "09-06-2022".
|
||||
" relative = true,
|
||||
"
|
||||
" -- `strftime` compatible format string.
|
||||
" -- Only used if `date.relative == false`
|
||||
" format = "%d-%m-%y",
|
||||
" },
|
||||
"
|
||||
" -- The highlight group to highlight the blame line with.
|
||||
" -- The highlight of this group defaults to `Comment`.
|
||||
" hl_group = "BlameLineNvim",
|
||||
"
|
||||
" -- The delay in milliseconds between a cursor movement and
|
||||
" -- when the blame line should appear/update
|
||||
" delay = 0,
|
||||
" }
|
||||
" EOF
|
||||
|
||||
|
||||
" Vim-markdown
|
||||
let g:vim_markdown_conceal = 0
|
||||
|
||||
lua << EOF
|
||||
require("todo-comments").setup {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
}
|
||||
EOF
|
||||
|
@ -1,115 +0,0 @@
|
||||
call plug#begin('~/.vim/plugged')
|
||||
|
||||
" % works on language specific keywords
|
||||
Plug 'andymass/vim-matchup'
|
||||
|
||||
" Accept .editorconfig
|
||||
Plug 'editorconfig/editorconfig-vim'
|
||||
|
||||
" Airline style status bar
|
||||
Plug 'vim-airline/vim-airline'
|
||||
Plug 'vim-airline/vim-airline-themes'
|
||||
|
||||
" Highlight and fix trailing whitespace
|
||||
Plug 'ntpeters/vim-better-whitespace'
|
||||
|
||||
" Yank History Cycling on meta-[shift]-p
|
||||
Plug 'maxbrunsfeld/vim-yankstack'
|
||||
|
||||
" Auto indent
|
||||
Plug 'yggdroot/indentline'
|
||||
|
||||
" Update folding less often
|
||||
Plug 'Konfekt/fastfold'
|
||||
|
||||
" Use FZF for browsing vim buffers
|
||||
Plug 'junegunn/fzf.vim'
|
||||
|
||||
" Markdown support
|
||||
Plug 'plasticboy/vim-markdown'
|
||||
|
||||
" Window resizing c-w [<>-+=_|]
|
||||
Plug 'roxma/vim-window-resize-easy'
|
||||
|
||||
" Regex highlighting and in buffer live replacement
|
||||
" Plug 'markonm/traces.vim'
|
||||
|
||||
" Better comments
|
||||
Plug 'scrooloose/nerdcommenter'
|
||||
|
||||
" Session Management
|
||||
Plug 'tpope/vim-obsession'
|
||||
|
||||
" Work on brackets in pairs
|
||||
Plug 'jiangmiao/auto-pairs'
|
||||
Plug 'tpope/vim-surround'
|
||||
|
||||
" NERDtree + Plugins
|
||||
Plug 'scrooloose/nerdtree'
|
||||
Plug 'jistr/vim-nerdtree-tabs'
|
||||
Plug 'Xuyuanp/nerdtree-git-plugin'
|
||||
Plug 'ryanoasis/vim-devicons'
|
||||
|
||||
" Compilers
|
||||
Plug 'xuhdev/singlecompile'
|
||||
|
||||
" Autocomplete
|
||||
Plug 'neoclide/coc.nvim', {'tag': 'v0.0.82'}
|
||||
Plug 'honza/vim-snippets'
|
||||
|
||||
" Language Specific stuff (Language Plugins, Linters, etc)
|
||||
" Asynchronous lint engine
|
||||
Plug 'dense-analysis/ale'
|
||||
Plug 'tpope/vim-endwise'
|
||||
|
||||
" Python
|
||||
Plug 'hdima/python-syntax'
|
||||
Plug 'fs111/pydoc.vim'
|
||||
Plug 'Vimjas/vim-python-pep8-indent'
|
||||
" Plug 'tmhedberg/SimpylFold'
|
||||
|
||||
Plug 'vim-scripts/javacomplete'
|
||||
Plug 'udalov/kotlin-vim'
|
||||
Plug 'xuhdev/vim-latex-live-preview'
|
||||
" Plug 'pearofducks/ansible-vim'
|
||||
Plug 'justinmk/vim-syntax-extra'
|
||||
|
||||
" Rust
|
||||
Plug 'timonv/vim-cargo'
|
||||
Plug 'rust-lang/rust.vim'
|
||||
|
||||
" DevOps
|
||||
Plug 'cespare/vim-toml'
|
||||
Plug 'mrk21/yaml-vim'
|
||||
Plug 'hashivim/vim-terraform'
|
||||
Plug 'pedrohdz/vim-yaml-folds'
|
||||
|
||||
" KIT-Color-Scheme
|
||||
Plug 'rad4day/kit.vim' " Original by taDachs <3 if you read this I may owe you a kœri
|
||||
Plug 'altercation/vim-colors-solarized'
|
||||
Plug 'sonph/onehalf', { 'rtp': 'vim' }
|
||||
Plug 'sainnhe/edge'
|
||||
|
||||
|
||||
" Git integration
|
||||
" Plug 'braxtons12/blame_line.nvim'
|
||||
Plug 'airblade/vim-gitgutter'
|
||||
Plug 'tpope/vim-fugitive'
|
||||
|
||||
" Plug 'godlygeek/tabular'
|
||||
Plug 'plasticboy/vim-markdown'
|
||||
|
||||
Plug 'majutsushi/tagbar'
|
||||
Plug 'rad4day/vim-ripgrep'
|
||||
|
||||
Plug 'github/copilot.vim'
|
||||
|
||||
" Fancy buffer handling
|
||||
Plug 'akinsho/bufferline.nvim', { 'tag': 'v2.3.0' }
|
||||
Plug 'johann2357/nvim-smartbufs'
|
||||
|
||||
Plug 'nvim-lua/plenary.nvim'
|
||||
Plug 'folke/todo-comments.nvim'
|
||||
|
||||
call plug#end()
|
||||
|
Loading…
Reference in New Issue
Block a user