mirror of
https://github.com/nvim-lua/kickstart.nvim.git
synced 2025-08-05 10:34:52 +02:00
fix: enable Nerd Font support and adjust font variant settings
This commit is contained in:
parent
7214203534
commit
ccd6fa7cf9
2 changed files with 47 additions and 5 deletions
|
@ -1,6 +1,50 @@
|
|||
local set = vim.opt_local
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
set.shiftwidth = 4
|
||||
set.tabstop = 4
|
||||
vim.g.sleuth_automatic = 0
|
||||
=======
|
||||
-- Use tabs instead of spaces
|
||||
set.expandtab = false -- Use real tabs, not spaces
|
||||
set.shiftwidth = 4 -- Size of an indent
|
||||
set.tabstop = 4 -- Size of a tab
|
||||
set.softtabstop = 0 -- Disable softtabstop
|
||||
>>>>>>> Stashed changes
|
||||
set.commentstring = '/* %s */'
|
||||
|
||||
-- Define a custom command ':IntMain' that inserts int main() {} template
|
||||
vim.api.nvim_create_user_command('IntMain', function()
|
||||
local current_line = vim.api.nvim_win_get_cursor(0)[1]
|
||||
local lines = {
|
||||
'#include <stdio.h>',
|
||||
'',
|
||||
'int main ()',
|
||||
'{',
|
||||
' ',
|
||||
' printf();',
|
||||
' return 0;',
|
||||
'}',
|
||||
}
|
||||
vim.api.nvim_buf_set_lines(0, current_line - 1, current_line - 1, false, lines)
|
||||
-- Position cursor inside the function body
|
||||
vim.api.nvim_win_set_cursor(0, { current_line + 1, 4 })
|
||||
end, {})
|
||||
|
||||
vim.api.nvim_create_user_command('Libft', function()
|
||||
local current_line = vim.api.nvim_win_get_cursor(0)[1]
|
||||
vim.api.nvim_buf_set_lines(0, current_line - 1, current_line - 1, false, {
|
||||
'#include "libft.h"',
|
||||
})
|
||||
end, {})
|
||||
|
||||
-- Force these settings after any other scripts might have changed them
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "c",
|
||||
callback = function()
|
||||
vim.opt_local.tabstop = 4
|
||||
vim.opt_local.shiftwidth = 4
|
||||
vim.opt_local.softtabstop = 4
|
||||
vim.opt_local.expandtab = true
|
||||
end
|
||||
})
|
8
init.lua
8
init.lua
|
@ -11,7 +11,7 @@ vim.g.loaded_netrwPlugin = 1
|
|||
vim.opt.termguicolors = true
|
||||
|
||||
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
||||
vim.g.have_nerd_font = false
|
||||
vim.g.have_nerd_font = true
|
||||
|
||||
-- Load options from options.lua
|
||||
require 'options'
|
||||
|
@ -708,8 +708,8 @@ require('lazy').setup({
|
|||
appearance = {
|
||||
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
-- Adjusts spacing to ensure icons are aligned
|
||||
-- nerd_font_variant = 'mono',
|
||||
nerd_font_variant = 'normal',
|
||||
nerd_font_variant = 'mono',
|
||||
-- nerd_font_variant = 'normal',
|
||||
},
|
||||
|
||||
completion = {
|
||||
|
@ -797,7 +797,6 @@ require('lazy').setup({
|
|||
end,
|
||||
},
|
||||
{
|
||||
|
||||
'polirritmico/monokai-nightasty.nvim',
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
|
@ -846,7 +845,6 @@ require('lazy').setup({
|
|||
{
|
||||
'tanvirtin/monokai.nvim',
|
||||
config = function()
|
||||
-- pcall(vim.cmd, [[colorscheme monokai]])
|
||||
require('monokai').setup { palette = require('monokai').classic }
|
||||
end,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue