Skip to content

Commit

Permalink
Mods: textadept
Browse files Browse the repository at this point in the history
  • Loading branch information
István Bozsó committed Apr 8, 2019
1 parent bcea3f7 commit 08fa484
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
28 changes: 28 additions & 0 deletions .textadept/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,34 @@ textadept.editing.auto_indent = true
buffer.tab_width = 4
buffer.use_tabs = false


-- local _L = require('locale')

-- local m_edit = textadept.menu.menubar[_L['_Edit']]
-- local m_sel = m_edit[_L['_Select']]


function xml()
local left, right = "<", ">"
buffer:begin_undo_action()
for i = 0, buffer.selections - 1 do
local s, e = buffer.selection_n_start[i], buffer.selection_n_end[i]
if s == e then
buffer:set_target_range(buffer:word_start_position(s, true),
buffer:word_end_position(e, true))
else
buffer:set_target_range(s, e)
end
buffer:replace_target(left..buffer.target_text..right..left.."/"..buffer.target_text..right)
buffer.selection_n_start[i] = buffer.target_end
buffer.selection_n_end[i] = buffer.target_end
end
buffer:end_undo_action()
end


keys["ct"] = xml

keys["ca"] = buffer.home
keys["ce"] = buffer.line_end
keys["am"] = textadept.run.compile
Expand Down
9 changes: 4 additions & 5 deletions .textadept/inmet
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
buffer: 98 98 0 /home/istvan/progs/insar_meteo/src/inmet.cpp
buffer: 118 118 0 /home/istvan/progs/insar_meteo/src/inmet.cpp
bookmarks:
buffer: 2470 2470 76 /home/istvan/progs/insar_meteo/inmet/cwrap.py
bookmarks:
buffer: 136 136 0 /home/istvan/progs/utils/.textadept/init.lua
buffer: 3930 3930 181 /home/istvan/progs/insar_meteo/src/aux/aux.hpp
bookmarks:
size: true 1366 715
view1: 3
view1: 1
current_view: 1
recent: /home/istvan/progs/insar_meteo/src/aux/aux.hpp
recent: /home/istvan/progs/utils/.textadept/init.lua
recent: /home/istvan/progs/insar_meteo/inmet/cwrap.py
recent: /home/istvan/progs/insar_meteo/src/inmet.cpp
Expand Down

0 comments on commit 08fa484

Please sign in to comment.