Compare commits

...

4 Commits

Author SHA1 Message Date
Ivan Polyakov 436ba147aa rofi removed 2 months ago
Ivan Polyakov 833c863182 vim upd 2 months ago
Ivan Polyakov b02c91f7f0 ts lsp 2 months ago
Ivan Polyakov ae96a5a73c add vim clap 0.54 3 months ago
  1. 98
      .config/rofi/config.rasi
  2. 11
      .config/rofi/themes/nord.rasi
  3. 2
      .config/vim/general.vim
  4. 1
      .config/vim/init.vim
  5. 6
      .config/vim/netrw.vim
  6. 46
      .config/vim/typograf.vim
  7. 9
      .vim/web.vimrc

98
.config/rofi/config.rasi

@ -1,98 +0,0 @@ @@ -1,98 +0,0 @@
configuration{
modi: "run,drun,window";
lines: 5;
font: "Iosevka 12";
show-icons: true;
icon-theme: "Oranchelo";
terminal: "st";
drun-display-format: "{icon} {name}";
location: 0;
disable-history: false;
hide-scrollbar: true;
display-drun: " Apps ";
}
@theme "nord"
element-text, element-icon , mode-switcher {
background-color: inherit;
text-color: inherit;
}
window {
height: 360px;
border: 3px;
border-color: @border-col;
background-color: @bg-col;
}
mainbox {
background-color: @bg-col;
}
inputbar {
children: [prompt,entry];
background-color: @bg-col;
border-radius: 5px;
padding: 2px;
}
prompt {
background-color: @blue;
padding: 6px;
text-color: @bg-col;
border-radius: 3px;
margin: 20px 0px 0px 20px;
}
textbox-prompt-colon {
expand: false;
str: ":";
}
entry {
padding: 6px;
margin: 20px 0px 0px 10px;
text-color: @fg-col;
background-color: @bg-col;
}
listview {
border: 0px 0px 0px;
padding: 6px 0px 0px;
margin: 10px 0px 0px 20px;
columns: 2;
background-color: @bg-col;
}
element {
padding: 5px;
background-color: @bg-col;
text-color: @fg-col ;
}
element-icon {
size: 25px;
}
element selected {
background-color: @selected-col ;
text-color: @fg-col2 ;
}
mode-switcher {
spacing: 0;
}
button {
padding: 10px;
background-color: @bg-col-light;
text-color: @grey;
vertical-align: 0.5;
horizontal-align: 0.5;
}
button selected {
background-color: @bg-col;
text-color: @blue;
}

11
.config/rofi/themes/nord.rasi

@ -1,11 +0,0 @@ @@ -1,11 +0,0 @@
* {
bg-col: #2E3440;
bg-col-light: #343a46;
border-col: #343a46;
selected-col: #343a46;
blue: #81A1C1;
fg-col: #b4bbc8;
fg-col2: #BF616A;
grey: #646a76;
width: 600;
}

2
.config/vim/general.vim

@ -2,6 +2,8 @@ set nocompatible @@ -2,6 +2,8 @@ set nocompatible
syntax on
" Editing settings
set autoindent
set cindent
set expandtab " use spaces
set tabstop=4
set shiftwidth=4

1
.config/vim/init.vim

@ -2,4 +2,5 @@ source ~/.config/vim/general.vim @@ -2,4 +2,5 @@ source ~/.config/vim/general.vim
source ~/.config/vim/paths.vim
source ~/.config/vim/netrw.vim
source ~/.config/vim/keybindings.vim
source ~/.config/vim/typograf.vim
source ~/.config/vim/lsp.vim

6
.config/vim/netrw.vim

@ -1,5 +1,9 @@ @@ -1,5 +1,9 @@
function! HideIgnoredByGit(...)
return substitute(substitute(system('git ls-files --other --ignored --exclude-standard --directory'), '\n', ',', 'g'), ',$', '', '')
endfunction
" let g:netrw_keepdir=0
let g:netrw_altv=1 " split window to the right
let g:netrw_liststyle=3 " tree style listing
let g:netrw_list_hide=netrw_gitignore#Hide()
let g:netrw_list_hide=HideIgnoredByGit()
let g:netrw_winsize = 30

46
.config/vim/typograf.vim

@ -0,0 +1,46 @@ @@ -0,0 +1,46 @@
function! SendVisualToHttp() range
let url = 'https://typograf.ru/webservice/?chr=UTF-8'
" Получаем выделенный текст
let [line_start, column_start] = getpos("'<")[1:2]
let [line_end, column_end] = getpos("'>")[1:2]
let lines = getline(line_start, line_end)
" Корректируем для выделения в пределах строки
if line_start == line_end
let text = lines[0][column_start-1 : column_end-1]
else
if column_start > 1
let lines[0] = lines[0][column_start-1 :]
endif
if column_end < strlen(lines[-1])
let lines[-1] = lines[-1][ : column_end-1]
endif
let text = join(lines, "\n")
endif
" URL-кодируем текст
let encoded_text = substitute(system('python3 -c "import urllib.parse; print(urllib.parse.quote(input()))"', text), '\n', '', 'g')
" Формируем полный URL
let full_url = url . (stridx(url, '?') == -1 ? '?' : '&') . 'text=' . encoded_text
" Отправляем запрос и получаем ответ
let response = system('curl -s -X POST ' . shellescape(full_url))
" Заменяем выделенный текст на ответ
if line_start == line_end
let new_line = lines[0][: column_start-2] . response . lines[0][column_end :]
call setline(line_start, new_line)
else
" Удаляем старые строки
execute line_start . ',' . line_end . 'd'
" Вставляем ответ (разбиваем по строкам если нужно)
let response_lines = split(response, '\n')
call append(line_start-1, response_lines)
endif
echo "Текст заменён ответом от сервера"
endfunction
command! -range -nargs=0 HttpSend <line1>,<line2>call SendVisualToHttp()

9
.vim/web.vimrc

@ -35,6 +35,15 @@ if executable("vscode-json-languageserver") @@ -35,6 +35,15 @@ if executable("vscode-json-languageserver")
}])
endif
if executable("typescript-language-server")
g:LspAddServer([{
name: 'tsserver',
filetype: ['javascript', 'typescript'],
path: 'typescript-language-server',
args: ['--stdio'],
}])
endif
if executable("intelephense")
g:LspAddServer([{
name: 'intelephense',

Loading…
Cancel
Save