Skip to content

Commit 786b0e0

Browse files
author
msevgi
committed
update nvim
1 parent 3338d39 commit 786b0e0

31 files changed

+2204
-15
lines changed

init.lua

Lines changed: 491 additions & 15 deletions
Large diffs are not rendered by default.

kullanım.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
tpope/vim-fugitive:
2+
Git işlemlerini Vim içinde kolay yapmayı sağlar.
3+
config fonksiyonunda iki kısayol tanımlanmış:
4+
5+
<leader>gg: Dikey bölmede :G komutunu çalıştırır (Fugitive Git arayüzü).
6+
7+
<leader>gb: :0G komutunu çalıştırır, buffer bazlı Fugitive.
8+
9+
'tpope/vim-rhubarb':
10+
GitHub ile entegrasyon sağlayan ufak eklenti (örneğin, :Gbrowse komutu verir).
11+
Burada sadece tanımlanmış, config verilmemiş.
12+
13+
14+
15+
----
16+
17+
18+
numToStr/Comment.nvim, Neovim/Vim için satır ve blok yorumlama işlemlerini kolaylaştırır.
19+
20+
Hem normal modda hem de visual modda kısayollar sağlar.
21+
22+
Varsayılan kullanım:
23+
Normal mod: gcc → Bulunduğun satırı yorumlar / yorumunu kaldırır
24+
25+
Visual mod: gc → Seçili satırları yorumlar / yorumunu kaldırır
26+
27+
Yani gcc tek satır, gc ise seçili alan üzerinde çalışır.
28+
Dosya tipine göre doğru yorum işareti (//, #, -- vb.) otomatik seçilir.
29+
30+
---
31+
32+
nvim-telescope/telescope.nvim
33+
-- Dosya arama
34+
vim.keymap.set('n', '<leader>ff', require('telescope.builtin').find_files, { desc = 'Dosya Ara' })
35+
36+
-- Metin içinde arama
37+
vim.keymap.set('n', '<leader>fg', require('telescope.builtin').live_grep, { desc = 'Metin Ara' })
38+
39+
-- Açık buffer'lar arasında geçiş
40+
vim.keymap.set('n', '<leader>fb', require('telescope.builtin').buffers, { desc = 'Buffer Ara' })
41+
42+
-- Yardım dökümanlarında arama
43+
vim.keymap.set('n', '<leader>fh', require('telescope.builtin').help_tags, { desc = 'Help Ara' })
44+
45+
46+
Kısayol Komut / Fonksiyon Açıklama
47+
<leader>sh help_tags Neovim yardım dosyalarında arama yapar.
48+
<leader>sk keymaps Tüm tanımlı keymap’leri listeler.
49+
<leader>sf find_files Projede dosya ismine göre arar.
50+
<leader>ss builtin Tüm Telescope picker’larını listeler.
51+
<leader>sw grep_string İmlecin altındaki kelimeyi proje içinde arar.
52+
<leader>sg live_grep Projede metin arar (ripgrep gerekir).
53+
<leader>sd diagnostics LSP’den gelen hataları ve uyarıları listeler.
54+
<leader>sr resume En son yapılan Telescope aramasını tekrar açar.
55+
<leader>s. oldfiles Son açılan dosyaları listeler.
56+
<leader><leader> buffers Açık buffer’lar arasında geçiş yapar.
57+
<leader>/ current_buffer_fuzzy_find Sadece açık olan buffer içinde bulanık arama yapar.
58+
<leader>s/ live_grep { grep_open_files = true } Sadece açık olan dosyalarda arama yapar.
59+
<leader>sn find_files { cwd = vim.fn.stdpath('config') }
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
-- autoformat.lua
2+
--
3+
-- Use your language server to automatically format your code on save.
4+
-- Adds additional commands as well to manage the behavior
5+
6+
return {
7+
'neovim/nvim-lspconfig',
8+
config = function()
9+
-- Switch for controlling whether you want autoformatting.
10+
-- Use :KickstartFormatToggle to toggle autoformatting on or off
11+
local format_is_enabled = true
12+
vim.api.nvim_create_user_command('KickstartFormatToggle', function()
13+
format_is_enabled = not format_is_enabled
14+
print('Setting autoformatting to: ' .. tostring(format_is_enabled))
15+
end, {})
16+
17+
-- Create an augroup that is used for managing our formatting autocmds.
18+
-- We need one augroup per client to make sure that multiple clients
19+
-- can attach to the same buffer without interfering with each other.
20+
local _augroups = {}
21+
local get_augroup = function(client)
22+
if not _augroups[client.id] then
23+
local group_name = 'kickstart-lsp-format-' .. client.name
24+
local id = vim.api.nvim_create_augroup(group_name, { clear = true })
25+
_augroups[client.id] = id
26+
end
27+
28+
return _augroups[client.id]
29+
end
30+
31+
-- Whenever an LSP attaches to a buffer, we will run this function.
32+
--
33+
-- See `:help LspAttach` for more information about this autocmd event.
34+
vim.api.nvim_create_autocmd('LspAttach', {
35+
group = vim.api.nvim_create_augroup('kickstart-lsp-attach-format', { clear = true }),
36+
-- This is where we attach the autoformatting for reasonable clients
37+
callback = function(args)
38+
local client_id = args.data.client_id
39+
local client = vim.lsp.get_client_by_id(client_id)
40+
local bufnr = args.buf
41+
42+
if client == nil then
43+
return
44+
end
45+
46+
-- Only attach to clients that support document formatting
47+
if not client.server_capabilities.documentFormattingProvider then
48+
return
49+
end
50+
51+
-- Tsserver usually works poorly. Sorry you work with bad languages
52+
-- You can remove this line if you know what you're doing :)
53+
if client.name == 'ts_ls' then
54+
return
55+
end
56+
57+
-- i want prettier to format json files
58+
if client.name == 'jsonls' then
59+
return
60+
end
61+
62+
-- Create an autocmd that will run *before* we save the buffer.
63+
-- Run the formatting command for the LSP that has just attached.
64+
vim.api.nvim_create_autocmd('BufWritePre', {
65+
group = get_augroup(client),
66+
buffer = bufnr,
67+
callback = function()
68+
if not format_is_enabled then
69+
return
70+
end
71+
72+
vim.lsp.buf.format {
73+
async = false,
74+
filter = function(c)
75+
return c.id == client.id
76+
end,
77+
}
78+
end,
79+
})
80+
end,
81+
})
82+
end,
83+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
local hsl = require('phoenix.utils.color').hsl
2+
3+
local Colors = {}
4+
5+
Colors.dark = {
6+
black = hsl(240, 7, 13),
7+
bblack = hsl(240, 7, 16),
8+
red = hsl(1, 83, 40),
9+
bred = hsl(1, 83, 50),
10+
bgreen = hsl(156, 100, 48),
11+
green = hsl(172, 100, 34),
12+
yellow = hsl(40, 100, 74),
13+
byellow = hsl(40, 100, 84),
14+
blue = hsl(220, 100, 56),
15+
bblue = hsl(220, 100, 66),
16+
magenta = hsl(264, 100, 64),
17+
bmagenta = hsl(264, 100, 72),
18+
cyan = hsl(180, 98, 26),
19+
bcyan = hsl(180, 100, 32),
20+
white = hsl(240, 7, 84),
21+
bwhite = hsl(240, 7, 94),
22+
}
23+
24+
Colors.dark.status_bg = Colors.dark.black
25+
Colors.dark.dimmed_text = hsl(240, 7, 25)
26+
27+
return Colors

0 commit comments

Comments
 (0)